wood burning stoves 2.0
The moose likes JSF and the fly likes Creating drop down on fly Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Creating drop down on fly" Watch "Creating drop down on fly" New topic

Creating drop down on fly

Tomasz Wolak

Joined: May 06, 2008
Posts: 10
I am trying to setup a very simple page. Two dropdown values of the second one are dependended on the first one:

basically upon clicking the button I want the form to be redrawn with features populated based on the application name.
Here is the form code:

the Simple.java is request scoped.

Now here is he the issue: the form works only EVERY second time. When submitted for the first time it works as designed, the form is re-drawn with the values of the second input influced by the fist one. However, on second click the values of the first one are reset to the initial state and not ate all dynamically set.
I have spend whole day on this and I am not any closer to solving this. Any suggestions on how to do this are welcome. If there is an alternative to redrawing the second dropdown upon change of the first one without resetting the whole page please let me know.
Thanks a million!
Darryl Nortje
Ranch Hand

Joined: Jun 11, 2002
Posts: 140

What happens when you put the managed bean into the session, as opposed to the request scope. I think that'll fix it "every second time" issue.

Tomasz Wolak

Joined: May 06, 2008
Posts: 10
Yes, changing the scope to "session" works. This however, does not solve my problem I don't want this "Simple" bean to be session scoped. The other thing is Why is it that the "action" is invoked only every second time if it's request scoped and all the time when it's session scoped?
Thanks for your help.
[ May 07, 2008: Message edited by: Tomasz Wolak ]
I agree. Here's the link: http://aspose.com/file-tools
subject: Creating drop down on fly
It's not a secret anymore!