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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Creating drop down on fly" Watch "Creating drop down on fly" New topic
Author

Creating drop down on fly

Tomasz Wolak
Greenhorn

Joined: May 06, 2008
Posts: 10
Hi:
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!
Tom
faces-config:
Darryl Nortje
Ranch Hand

Joined: Jun 11, 2002
Posts: 140
howzit,

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.

cheers
Darryl
Tomasz Wolak
Greenhorn

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.
Tom
[ 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
 
Similar Threads
Validation Error on SelectOneMenu
Help - question on selectOneListbox and page reloads
Something missing with dynamic faces (Ajax) simple example
Strange behavior: action method not called when button submitted
SelectItem Help needed