aspose file tools*
The moose likes Struts and the fly likes Reset the collection content in bean:define Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Reset the collection content in bean:define" Watch "Reset the collection content in bean:define" New topic
Author

Reset the collection content in bean:define

Ravi Petchimuthu
Greenhorn

Joined: May 31, 2007
Posts: 15
Hi,

I am using ajax, bean efine for html:select and html ptions.

Here I need to reset the listcontent available for bean efine with the new list.

For Ex: Country list and State list are there, based on the country selection I need to update the state list using ajax.

Now I can able to get the StateList generated in my action as well as form but its not reflecting in jsp(bean efine shows the old value).

Regards,
Ravi.P
Marimuthu Madasamy
Ranch Hand

Joined: Jun 07, 2007
Posts: 72

Originally posted by Ravi Petchimuthu:
Now I can able to get the StateList generated in my action as well as form but its not reflecting in jsp(bean efine shows the old value).


All the struts tags (including ) will be executed when the entire JSP page is loaded. In case of AJAX, i hope you are not reloading the entire page. So has got nothing to do here in AJAX requests.

So my suggestion is,

in your action class,
Populate the list from db and make it available in request scope.



in struts-config.xml,



in StatesXMLView.jsp,




In JavaScript file,



Hope this helps.

- Marimuthu M


- Marimuthu Madasamy
 
wood burning stoves
 
subject: Reset the collection content in bean:define