3 Replies Latest reply on Feb 24, 2012 8:13 AM by ibstmt

    Unable to invoke action of <a4j:suppport> within a <rich:sugestionBox>

    Vinod KP Newbie

      I have a requirement wherein when the user selects anything from the rich:ssuggestion option, an action should be invoked to the back-end and display that selection on the page. Please see the below code snippet:

       

      xhtml code

      ----------------

       

      <h:inputText id="inputCorporationId" value="#{corporationBankAccount.corporation.name}" />

                                                                                                <rich:suggestionbox width="700" height="200" for="inputCorporationId"

                                                                                                                    suggestionAction="#{corporationManager.suggestCorporation}" var="corporation"

                                                                                                                    fetchValue="#{corporation.corporation.name}" nothingLabel="No Matching Types"

                                                                                                                    id="corporationSuggestionId">

       

                                                                                                                    <a4j:support id="suggestionSelectId" event="onselect" action="#{corporationManager.select(corporation)}"

                                                                                                                                        reRender="corporationContentDetailPanel"  />

       

                                                                                                                    <h:column>

                                                                                                                              <f:facet name="header">

                                                                                                                                        <h:outputText value="#{msg.corporation}" />

                                                                                                                              </f:facet>

                                                                                                                              <h:outputText value="#{corporation.corporation.name}" />

                                                                                                                    </h:column>

                                                                                                                    <h:column>

                                                                                                                              <f:facet name="header">

                                                                                                                                        <h:outputText value="#{msg.productions}" />

                                                                                                                              </f:facet>

                                                                                                                              <h:outputText value="" />

                                                                                                                    </h:column>

                                                                                                                    <h:column>

                                                                                                                              <f:facet name="header">

                                                                                                                                        <h:outputText value="#{msg.fedtaxid}" />

                                                                                                                              </f:facet>

                                                                                                                              <h:outputText value="#{corporation.corporation.federalTaxId}" />

                                                                                                                    </h:column>

                                                                                                                    <h:column>

                                                                                                                              <f:facet name="header">

                                                                                                                                        <h:outputText value="#{msg.statetaxid}" />

                                                                                                                              </f:facet>

                                                                                                                              <h:outputText value="#{corporation.corporation.stateTaxid}" />

                                                                                                                    </h:column>

                                                                                                                    <h:column>

                                                                                                                              <f:facet name="header">

                                                                                                                                        <h:outputText value="#{msg.opendate}" />

                                                                                                                              </f:facet>

                                                                                                                              <h:outputText value="#{corporation.corporation.openDate}" />

                                                                                                                    </h:column>

                                                                                                                    <h:column>

                                                                                                                              <f:facet name="header">

                                                                                                                                        <h:outputText value="#{msg.closedate}" />

                                                                                                                              </f:facet>

                                                                                                                              <h:outputText value="#{corporation.corporation.closeDate}" />

                                                                                                                    </h:column>

       

                                                                                                          </rich:suggestionbox>

                                                                                      </h:panelGrid>

       

      backingbean code

      ----------------------------

      @Override

          public void select (final CorporationBankAccount corporationBankAccount)

          {

              if (m_log.isDebugEnabled ())

              {

                  m_log.debug ("Invoked corporationBankAccounts select()");

              }

              setEditable (true);

              if (null == corporationBankAccount)

              {

                        System.out.println("inside select ---- corporationBankAccount is null");

                  final List <Corporation> corporations = m_corporationService.getAkas (m_corporationBankAccount

                                  .getCorporation ());

                  m_corporationBankAccounts.clear ();

                  for (final Corporation corporation : corporations)

                  {

                      CorporationBankAccount.addCorporationBankAccounts (corporation, m_corporationBankAccounts);

                  }

              }

              else

              {

                        System.out.println("inside select ---- corporationBankAccount is :" +corporationBankAccount);

                  m_corporationBankAccount = corporationBankAccount;

              }

       

      The action is not invoked from the <a4j:support> tag. Please help. Any suggestion is welcome.