One of the input fields of my form should be mandatory in dependency of the currently selected item of an item list. The label of this input field should be bold only if the value of the list is (e.g) 2 or 3. This should be done without validating any other field.
So I wrote this valueChangeListener:
But the event obviously occurs only when the whole form is submitted, evan with immediate="true". But then all other fields are validated also
Because I'm new to JSF, I don't understand, which action is fired at which time.
Sorry for my english and many thanks for your help!
Joined: May 28, 2010
In the meantime I've found out, I was successful (beside fixing some errors in the listener) with <f:ajax ...
I faced the same issue.
it worked for me, but when you submit the page without selecting any value from dropdown then valueChangeListener is called once and then for the second click page is submitting resulting in double submission of a page when dropdown is not altered
if you change the dropdown once, then for single submission is working fine.
If you use RichFaces, this is fairly simple. Your valuechangelistener only needs to set a "render" flag. Use the ajaxSingle attribute on the AJAX event definition to limit input to just the input control in question and a reRender= that includes the control whose state you want updated. The valuechangelistener ONLY needs to set a flag - no mucking around with the component tree is required, since RichFaces does all the sordid little details automatically, as long as the affected control has its render= attribute set to monitor the flag that the valuechangelistener toggles.
Customer surveys are for companies who didn't pay proper attention to begin with.