1 2 Previous Next 17 Replies Latest reply on Apr 5, 2007 7:02 AM by Ilya Shaikovsky

    suggestionbox event triggers form submit, second setter pass

    shooali Newbie

      Hi,

      I have a problem using suggestionbox:
      when entering some thing into the inputtext bound to the suggestion box, the whole form is submitted (which is ok, since I did not define any region), the problem happens in a selectOneRadio component I have on the same page, that in the second call to it's vaue's property setter, a null is passed as parameter. I have no idea where it comes from, and it does not seem to pass through the validator defined there at all.
      If instead, I just put a a4j:support on the page, that triggers a full form submit, every thing works fine.

      Please find attached the page source.

      any help is most appreciated.

      Thanks,

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <html xmlns="http://www.w3.org/1999/xhtml"
       xmlns:ui="http://java.sun.com/jsf/facelets"
       xmlns:h="http://java.sun.com/jsf/html"
       xmlns:f="http://java.sun.com/jsf/core"
       xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
       xmlns:c="http://java.sun.com/jstl/core"
       xmlns:jp="http://www.jenia.org/jsf/popup"
       xmlns:af="http://www.emc.com/ajax/jsf"
       xmlns:t="http://myfaces.apache.org/tomahawk"
       xmlns:rich="http://richfaces.ajax4jsf.org/rich">
      
      
      <body>
      
       <ui:composition>
       <h:form id="myform">
       <c:set var="pageBean" value="#{policyEditingWizardStageAddCustomConstraintBean}"/>
      
       <h:selectOneRadio id="constraintKindRadio"
       value="#{pageBean.selectedConstraintKind}"
       layout="pageDirection"
       converter="constraintKindConverter">
       <f:selectItems id="constraintKindItems" value="#{pageBean.constraintKindItems}"/>
       <a4j:support event="onclick" reRender="allPanels"/>
       </h:selectOneRadio>
      
       <!-- ****************************************************** -->
       <!-- radio buttons above show and hide the following panels. -->
       <!-- ****************************************************** -->
       <h:panelGroup id="allPanels">
       <h:panelGroup
       id="ConfigItemAttributePanel"
       rendered="#{pageBean.configItemAttributeKind}">
       <h:inputText id="configItemAttributePath" value="#{pageBean.ciAttributeBean.path}"/>
       <!-- <a4j:support event="onclick" reRender="configItemAttributePath"/> -->
       <rich:suggestionbox
       id="attributePathSuggestBox"
       for="configItemAttributePath"
       var="attributePathSuggestion"
       suggestionAction="#{pageBean.configItemAttributeSuggestions}"
       selfRendered="true">
       <h:column>
       <h:outputText value="#{attributePathSuggestion}"/>
       </h:column>
       </rich:suggestionbox>
       </h:panelGroup>
       <h:panelGroup
       id="FilePropertyPanel"
       rendered="#{pageBean.filePropertyKind}">
       <h:outputText value="file property"/>
       </h:panelGroup>
       <h:panelGroup
       id="ConfigItemCountPanel"
       rendered="#{pageBean.configItemCountKind}">
       <h:outputText value="config item count"/>
       </h:panelGroup>
       </h:panelGroup>
       </h:form>
      </ui:composition>
      </body>
      </html>
      


        1 2 Previous Next