0 Replies Latest reply on Aug 28, 2008 8:04 PM by gopi b

    seam bugreport

    gopi b Newbie
      I created suggestion box for country(nationality) using rich faces, and seam the problem am facing is "Only the topmost name in the list of the countries is displaying if also I select the country in the list of countries (like If I type "A", countries name starting with 'A' are displaying, at this time only the top most country is selected, If I select any of them).
      Action class

      public List autoComplete(Object suggest){
               String pref = (String)suggest;
                   ArrayList result = new ArrayList();
                   Iterator iterator = getAllData().iterator();
                       NationalityList nationality = (NationalityList)iterator.next();
                       if((nationality!=null && nationality.getCountry().toLowerCase().indexOf(pref.toLowerCase())==0)||"".equals(pref)){    
                   return result;
              public ArrayList getAllData(){
                  ArrayList<NationalityList> tempList2 = new ArrayList<NationalityList>();
                  tempList2 = (ArrayList<NationalityList>) getEntityManager().createQuery("from NationalityList order by id").getResultList();
                      for(NationalityList nationality : tempList2)
                  return nationalityList;


                      <h:inputText id="nationality"   required="true" value="#{mortgageApplicantHome.instance.individualApplicant.personal_Nationality}"
                          styleClass="formFont, formColumnInputText" validator="#{applicationValidators.checkBlankSpaces}"
                          requiredMessage="Please Enter Nationality">
                          <f:validateLength minimum="1" maximum="40" />                  
                      <rich:suggestionbox id="nationalityID" for="nationality"
                                  suggestionAction="#{mortgageApplicantHome.autoNatList}" var="result"
                                  minChars="0" nothingLabel="No Nationality found" columnClasses="center">
                        <h:outputText value="#{result.nationality}"/>