-
Jan 25th, 2007, 12:54 PM
#15
Hello there,
First of all, thanks for your help.
[QUOTE=sbtourist;97917]
What kind of browser are you using? Have you tried with a different one?
[QUOTE]
I have tried with IE 6.0 and Firefox 1.5.0.9. With IE i got an error message "Object is required" and with Firefox nothing happens
I tried changing some lines in springxt.js in order to cath the ResponseText instead of ResponseXML, I also change my html code, I added a div to get the ResponseText. When I did that, error message disappered but I got no answer, it seems it never got the "complete" state (state number 4).
I am complete cluless, any idea will be so appreciated.
LJ.
P.D. Just in case, I am sending como of code I am using. (with the original form of springxt.js -catching ResponseXML-)
This is my html page:
<form name="form1" id="form1" method="post" action="">
<input name="button" type="button" onclick="JavaScript:XT.doAjaxAction('loadOffices', this);" value="Press" />
<div id="divTest">
<select name="select" id="offices">
<option>--- ---</option>
</select>
</div>
</form>
This is my loadOffices method:
public class AjaxHandler extends org.springmodules.xt.ajax.AbstractAjaxHandler{
public AjaxResponse loadOffices(AjaxActionEvent event){
Collection<String> offices = new Vector<String>();
offices.add("One");
offices.add("Two");
offices.add("Three");
List<Component> options = new LinkedList<Component>();
Option first = new Option("-1", "Select one ...");
options.add(first);
for(String office : offices) {
Option option = new Option(office, "officeId", "name");
options.add(option);
}
ReplaceContentAction action = new ReplaceContentAction("offices", options);
AjaxResponse response = new AjaxResponseImpl();
response.addAction(action);
return response;
}
}
This is part of my dispatcher :
<bean id="ajaxLoadOfficesHandler" class="controller.AjaxHandler">
</bean>
<bean id="ajaxInterceptor" class="org.springmodules.xt.ajax.AjaxInterceptor">
<property name="handlerMappings">
<props>
<prop key="/ajax/tutorial.html">ajaxLoadOfficesHandler</prop>
</props>
</property>
</bean>
<bean id="urlMapping" class="org.springframework.web.servlet.handler.Sim pleUrlHandlerMapping">
<property name="interceptors">
<list>
<ref bean="ajaxInterceptor"/>
</list>
</property>
<property name="mappings">
<props>
<prop key="/**/*.html">staticViewController</prop>
<prop key="/action/*.action">eventController</prop>
</props>
</property>
</bean>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules