wood burning stoves 2.0*
The moose likes JSF and the fly likes Value change listener in select one menu Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Value change listener in select one menu" Watch "Value change listener in select one menu" New topic
Author

Value change listener in select one menu

Joshua Antony
Ranch Hand

Joined: Jun 05, 2006
Posts: 254
The scenario is:

I have a page consisting of SelectOneMenu and different text fields. Based on the values selected from the select one menu,
some of the text fields need to be made mandatory.
Using onchange = "submit()" will validate other fields also, which I do not want to do at this time.

Hence I have used code as shown below which invokes a command button(that has immediate=true so that validation will
not be performed for other fields) when values are changed . In the value changed event method , I set the rendered property
of the mandatory text field.




The problem is that the value changed listener is never getting invoked
My thinking is that using immediate=true will only skip Convertion ,Validation and update model phase and the listener should be called
as is.

Regards,
Joshua


SCJP,SCWCD, Into ATG now!
Joshua Antony
Ranch Hand

Joined: Jun 05, 2006
Posts: 254
I think I got the point. Did some logging and found that value change listener is called in Process Validation phase and hence while using immediate=true, it was not getting fired.

Is there a way to achieve the funtionality of showing the mandatory fields depending on the values selected from dropdown without processing validations for the other fields?

Regards,
Joshua
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Value change listener in select one menu
 
Similar Threads
JSF partial validation
JSF valuechangeListener not detecting a change for values entered manually in a text field.
Value change listener updating bean
JSF drop down problem
Getting One Dropdown Menu Selection to Affect the Values of a Second Dropdown Menu