I have two pages page1.jsp and page 2.jsp each with managed beans called page1 and page2 respectively in the request scope as shown below
page1 has a selectOneMenu. I also have a command button on page1 which goes to page2. Page2�s purpose is to collect information to add a selectItem to the selectOneMenu on page1.
Partial code shown below, values hardcoded for clarity. The idea here is to save the contents on page1 in some session scoped object, in the page2 action method create a fresh page1bean, update it with the original values, then redisplay page1 with the newly updated values
When I am returned to page1.jsp I see the selectOneMenu list has been updated and everything looks fine. The problem occurs when I then hit the submit button on the redisplayed page1. The item I added disappears from the list.
What�s happening here?
The only happens with the selectOnemenu component. Other inputText components work fine. [ May 12, 2005: Message edited by: Gregg Bolinger ]
What I do it change from the request scope to session scope. If the managed bean is used across multiple pages this is the way I have seen it done and works for me. I normally add a reinit() method to call when I am done with the bean since it remains with the session.
I'd love to test our your problem however I don't feel like creating the entire app from scratch. If you could provide me with your page1.jsp, page2.jsp and appropriate backing bean(s) I can then plugin some static values for the dropdown(s) and see what the problem is.
I have gone to look for myself. If I should return before I get back, keep me here with this tiny ad: