This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Struts and the fly likes Reset the collection content in bean:define Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Frameworks » Struts
Reply 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
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Reset the collection content in bean:define
 
Similar Threads
Stuck with optionsCollection Tag
How to write in AJAX
Cannot find bean: "Element" in any scope
2 Drop Down JSF: AJAX: hx:ajaxRefreshRequest
how to assign bean value to jsp variable in struts