1 Reply Latest reply on Oct 1, 2009 1:07 AM by Bernard Labno

    Help suggestionBox - suggestionAction event not fired in ui repeat

    Val Sw Expert

      I am trying to implement suggestion box in ui repeat, for testing I am using single field..
      First suggestionBox works fine as expected, somehow when I use the same in ui repeat suggestionAction event is not fired..


      Please give your valuable inputs it will be very helpful.


      XHTML


      <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
                                "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:s="http://jboss.com/products/seam/taglib"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:a="http://richfaces.org/a4j"
                xmlns:rich="http://richfaces.org/rich"
                xmlns:c="http://java.sun.com/jstl/core"
                template="layout/template.xhtml">
                        
      <ui:define name="body">
      
      <h:messages globalOnly="true" styleClass="message" errorClass="errors" infoClass="info" id="globalMessages"/>     
      
      <h:form id="proj" styleClass="edit">
      //THIS WORKS FINE
      <h:inputText value="#{cellLinesBean.cell}" id="text1" />
           <rich:suggestionbox id="suggestionBoxId1" for="text1" tokens=",[]"
                suggestionAction="#{itemLinesBean.autocomplete}" var="result"
                fetchValue="#{result.itemName}"
                nothingLabel="No items found" columnClasses="center"
                usingSuggestObjects="true">
                <h:column>
                     <h:outputText value="#{result.itemName}" />
                </h:column>
           </rich:suggestionbox>
      <rich:panel id="reagentPanel">
      <table><thead>...</thead>            
           <ui:repeat value="#{projHome.reg}" var="info" >            
           <tbody>
                <td>
                   <s:decorate id="type" template="layout/edit.xhtml">          
                    <h:inputText id="type" required="true" value="#{info.type}"/>
                   </s:decorate>
           </td>
           <td>
           //NOT WORKING, SUGGESTIONACTION EVENT IS NOT FIRED
               <h:inputText value="#{itemLinesBean.item}" id="text"/>
                <rich:suggestionbox id="suggestionBoxId" for="text" tokens=",[]"
                    suggestionAction="#{itemLinesBean.autocomplete}" var="result"
                fetchValue="#{result.itemName}"
                  nothingLabel="No items found" columnClasses="center"
                usingSuggestObjects="true">
           <h:column>                                  
                     <h:outputText value="#{result.itemName}"/>
           </h:column>
           </rich:suggestionbox>
           </td>
           ....
           </tbody>
           </ui:repeat>
      </table>
      </rich:panel>
      
      <div class="actionButtons" align="center">     
      <h:commandLink id="add" action="#{projHome.addreg}" 
      value="Add More regs"/>
      </div>  
      <div class="actionButtons">       
      <h:commandLink id="save" action="#{projHome.persist}"..>
      Save</h:commandLink>...
      </div>
      </h:form>
      </ui:define>
      </ui:composition>