The scenario is:  I have a page consisting of SelectOneMenu and different t

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.
<h:selectOneMenu id="source" value="#{companyPaymentRemark.prVO.sourceID}" 
    onchange="buttonClick('layout:content:hiddenSubmit')" valueChangeListener="#{companyPaymentRemark.sourceValueChange}"> 
            <f:selectItems value="#{companyPaymentRemark.sourceList}" /> 
     </h:selectOneMenu> 
    <h:commandButton id="hiddenSubmit" immediate="true" action="" style="display:none"/> 
<h:selectOneMenu id="source" value="#{companyPaymentRemark.prVO.sourceID}" onchange="buttonClick('layout:content:hiddenSubmit')" valueChangeListener="#{companyPaymentRemark.sourceValueChange}"> <f:selectItems value="#{companyPaymentRemark.sourceList}" /> </h:selectOneMenu> <h:commandButton id="hiddenSubmit" immediate="true" action="" style="display:none"/>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

This article may be helpful then: [http://balusc.blogspot.com/2007/10/populate-child-menus.html].

Similar Messages

Maybe you are looking for