Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Creating drop down on fly

 
Tomasz Wolak
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 140
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic