2 Replies Latest reply on Oct 19, 2009 9:28 AM by Ilya Shaikovsky

    commandLink/commandButton within suggestionBox

    Mason Harding Newbie

      I am having a difficult time getting commandLink/commandButton to work within a suggestionBox. in the following code both the link in the nothingLabel and in the header will be displayed, but clicking the nothingLabel link will not trigger the onclick, nor will it perform Any AJAX action. The link in the header will work about 2/3rds of the time. This seems to be the case in Firefox and in IE. I do not see a javascript error when it doesnt fire in firebug or in a4j:log.

      <h:inputText id="eI" value="#{testBean.finalName}"
       immediate="true"
       ajaxSingle="true"/>
      <rich:suggestionbox id="testSB"
       height="200" width="300" frequency="0"
       selfRendered="true" ajaxSingle="true"
       suggestionAction="#{testBean.listNames}" var="cat"
       fetchValue="#{cat.Name}" status="stat"
       for="eI" eventsQueue="q"
       requestDelay="0" immediate="true"
       onsubmit="selectedFromList = false;">
       <f:facet name="nothingLabel">
       <a4j:commandLink eventsQueue="q"
       action="#{testBean.setIsNew(true)}"
       value="Not found, click to add"
       onclick="alert('clicked!')"/>
       </f:facet>
       <f:facet name="header">
       <a4j:commandLink eventsQueue="q"
       action="#{testBean.setIsNew(true)}"
       value="click to add new"
       onclick="alert('clicked!')"/>
       </f:facet>
       <h:column>
       <h:outputText value="#{cat.Name}" />
       </h:column>
      </rich:suggestionbox>
      


      Thanks for your help all!
      Mason