0 Replies Latest reply on Jun 2, 2007 4:43 AM by mkaliyur

    <a4j:support not picking up selected value from selectOneMen

    mkaliyur

      Hi Guys,
      I need some help.

      I'm unable to resolve a strange issue with <h:selectOneMenu and a4j:support - SelectOneMenu dropdown items are dynamically created with backing beans and it displays properly. The enclosing form also has few other selectOneMenu components. for some reason, the issue below doesnot occur for one of the selectOneMenus, but occurs on all others - When I select an item from dropdown, the display changes. Problem is , an a4j:support component inside the selectOneMenu fails to pickup the selected value - I've verified that the backing bean is correctly creating both display value and the key correctly for all dropdown items. The code snippet is as below -

       <c:if test="#{entity.typeLookup}">
      
       <h:selectOneMenu id="#{fieldName}#{idattach}Lookup"
       value="#{entity.currentSelectionString}"
       converter="#{entity.converter}"
       converterMessage="Test Convert Message"
       >
       <f:selectItems value="#{entity.selectOptionsList}" />
       <a4j:support event="onchange" onsubmit="alert(this.value)" ajaxSingle="true" action="#{entity.dummy}"></a4j:support>
       </h:selectOneMenu>
      
       <a4j:outputPanel>
       <h:message id="#{fieldName}#{idattach}MessageLookup"
       style="color: red;" for="#{fieldName}#{idattach}Lookup" />
       </a4j:outputPanel>
      
       </c:if>
      
      


      The alert on 'onsubmit' comes up with null, but the display on the selectOneMenu shows the selected item.

      The above code to create selectOneMenu is part of a template and all selectOneMenu's of the above form are from same template- so I dont understand why one of the dropdowns work (only the first) and all others doesnt pickup the selected value.

      if the value is null, jsf doesnt hit the converter! I've been struggling with this from morning!

      environment is a4j snapshot as of 5/31, jsf1.2, seam and facelets.

      Not sure where I'm going wrong. I appreciate any inputs.

      Thanks in advance!

      Manju