8 Replies Latest reply on Mar 24, 2011 5:01 AM by Job Mathew Kollamana

    Rich:SuggestionBox  Help!!! Not working properly

    Job Mathew Kollamana Newbie

      Hi,

       

      Am new into Web development and to richface.

       

      currently am trying to make a suggestion box for an input text.

      But the problem is right after the first key press am getting the suggestion values but not in suggestion box.

      and no more filtering happens after that. here is my code:

       

      Any help is appreciated.

       

      Thanks in Advance.

       

      Please have a look at the attachment

       

       

      <h:form id="addUserForm">

                  <rich:messages style="color:red;"></rich:messages>

                  <h:panelGrid columns="1">

                      <a4j:outputPanel  ajaxRendered="true">

                          <rich:panel>

                              <h:panelGrid columns="2">

                                  <h:outputText value="User Name" />

                                  <h:panelGroup>

                                      <h:inputText value="#{manageUserBean.userName}" id="addUserNameTextBox" />

                                        <rich:suggestionbox ajaxSingle="true" for="addUserNameTextBox" nothingLabel="No user found" suggestionAction="#{manageUserBean.autoComplete}" var="suggest" tokens=",">

                                               <h:column>

                                                  <h:graphicImage value="/Image/addUser1.png" />

                                              </h:column>

                                               <h:column>

                                                  <h:outputText value="#{suggest}" />

                                               </h:column>                                    

                                               <a4j:support ajaxSingle="true" event="onselect" action="#{manageUserBean.fetchUserDetail}" reRender="addUserForm">

                                                  <f:setPropertyActionListener value="#{suggest}" target="#{manageUserBean.userName}" />

                                               </a4j:support>

                                        </rich:suggestionbox> 

                                    </h:panelGroup>

                                   <h:outputText value="System Access level" />

                                  <rich:comboBox selectFirstOnUpdate="false" required="true" requiredMessage="Enter Valid Access Group" value="#{manageUserBean.accessGroup}" id="accessGroupComboBox"

                                      defaultLabel="Enter Access Level" suggestionValues="#{manageUserBean.accessLevels}">

                                  </rich:comboBox>

                                  </h:panelGrid>

                          </rich:panel>

                          <rich:panel>

                            <h:panelGrid columns="2">

                                  <h:outputText value="First Name" />

                                  <h:outputText value="#{manageUserBean.newUser.firstName}" />

                                  <h:outputText value="Middle Name" />

                                  <h:outputText value="#{manageUserBean.newUser.middleName}" />

                                  <h:outputText value="Last Name" />

                                  <h:outputText value="#{manageUserBean.newUser.lastName}" />

                                  <h:outputText value="Email Name" />

                                  <h:outputText value="#{manageUserBean.newUser.email}" />

                            </h:panelGrid>

                          </rich:panel>

                          <rich:message showSummary="true" showDetail="false" for="price" />

                      </a4j:outputPanel>

                      <h:panelGrid columns="2">

                          <a4j:commandButton value="Add"  action="#{manageUserBean.addUser}"  reRender="table"

                              oncomplete="if (#{facesContext.maximumSeverity==null}) #{rich:component('addUserPanel')}.hide();" />

                          <a4j:commandButton value="Cancel"  immediate="true" action="#{manageUserBean.cancelAddUser}" oncomplete="#{rich:component('addUserPanel')}.hide();"/>

                      </h:panelGrid>

                  </h:panelGrid>

              </h:form>