6 Replies Latest reply on May 14, 2011 12:59 AM by ainanmis

    rich:autocomplete doesn't display data althought autocomplete returns a List instance

    ainanmis

      rich:autocomplete doesn't display any data, althought autocompleteMethod returns a List instance.

      I am using it inside rich:tabPanel.

       

      can you help please?

       

      <rich:autocomplete id="brans" mode="cachedAjax" minChars="0" styleClass="brans"

                       value="#{provizyonBean.provizyonTalep.doktorBilgileri.brans}"

                       var="b" fetchValue="#{b.str}"

                       autocompleteMethod="#{provizyonBean.autocompleteBrans}"

                       required="true" requiredMessage="Branş alanı girilmek zorundadır">

                       <f:converter converterId="nameValueDtoConverter2"></f:converter>

                        <h:column>

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

                       </h:column>

                        <h:column>

                            <h:outputText value=" " />

                       </h:column>

                       <h:column>

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

                       </h:column>

       

           </rich:autocomplete>

        • 1. Re: rich:autocomplete doesn't display data althought autocomplete returns a List instance
          ainanmis

          I noticed if rich:tabPanel disable attribute value is false and after it becomes true, rich:autoComplete doesn't display any data.

          • 2. Re: rich:autocomplete doesn't display data althought autocomplete returns a List instance
            ainanmis

            I noticed also If rich:tabPanel switchType is client , autocomplete works correctly.  if it is  ajax, it has displaying problem.

            • 3. Re: rich:autocomplete doesn't display data althought autocomplete returns a List instance
              iabughosh

              maybe your method #{provizyonBean.autocompleteBrans} returns list of beans, if that so you can override your bean's method toString() to match your requirement, or change the return type of your method to List<String>, and about the data problem, make sure that your tab panel switchMode and your auto complete mode are in sync, ex : if tabPanel switchType="client" mode="client or lazyClient", switchType="ajax" mode="ajax or cachedAjax"

               

              regards.

              • 4. Re: rich:autocomplete doesn't display data althought autocomplete returns a List instance
                ilya_shaikovsky

                Add layout="table" to the component. in other case it will ignore your columns and just create simple div based layout using toString on your objects. Also if will be problems please try to use rich:column instead of h:

                 

                And if still will not be able to solve - please  provide more complete code including your tabs.

                • 5. rich:autocomplete doesn't display data althought autocomplete returns a List instance
                  ainanmis

                  I added layout="table" and  I used rich:column, but it didn't work.     My some code parts is below.

                   

                   

                  <rich:tabPanel id="tp"   switchType="ajax" activeItem="#{provizyonBean.selectedTab}" >

                                                      <rich:tab  id="hasta" header="Hasta Bilgi Formu" styleClass="hastaTabi">

                                                            <ui:include src="/hastaBilgi.xhtml"></ui:include>

                                                   </rich:tab>

                                                   

                                                   <rich:tab id="doktor" name ="doktor"  header="Doktor Bilgileri" disabled="#{provizyonBean.doktor}">

                                                             <a4j:outputPanel layout="block" id="doktorWrapper">

                                                             <ui:include src="/doktorBilgi.xhtml"></ui:include>

                                                                  </a4j:outputPanel>   

                                                      </rich:tab>

                   

                  </rich:tabPanel>

                   

                   

                   

                   

                  doktorBilgi.xhtml includes  below code.

                  <rich:autocomplete id="brans" mode="cachedAjax" minChars="0"

                                       value="#{provizyonBean.provizyonTalep.doktorBilgileri.brans}"

                                       var="b" fetchValue="#{b.str}"

                                       autocompleteMethod="#{provizyonBean.autocompleteBrans}" layout="table"

                                       required="true" requiredMessage="Branş alanı girilmek zorundadır" inputClass="brans"

                                       showButton="true">

                                       <f:converter converterId="nameValueDtoConverter2"></f:converter>

                                        <rich:column>

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

                                       </rich:column>

                                       <rich:column>

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

                                       </rich:column>

                                  

                                     </rich:autocomplete>

                  • 6. rich:autocomplete doesn't display data althought autocomplete returns a List instance
                    ainanmis

                    I used rich:select instead of rich:autocomplete.

                    1 of 1 people found this helpful