0 Replies Latest reply on Dec 23, 2010 10:52 AM by Marco Lavecchia

    problem with ric:suggestionBox and set Object in a bean

    Marco Lavecchia Newbie

      hi

      I use a a suggestionBox component for search object <fornitore> Tipe.

      The suggestion works correctely, but i want set the Selected Object in my Vista ( vistaGestioneFatture)

       

      i write this jsf page

      <h:panelGrid columns="2" styleClass="allineaSinistra" >
                  <h:outputText value="RICERCA PER RAGIONE SOCIALE" style="font-weight:bold"/>
                  <h:panelGrid columns="2" border="0" cellpadding="0" cellspacing="0">
                      <h:inputText style="margin:0px;" id="ragioneSocialeFornitore" value="#{controlloGestioneFatture.suggest.fornitore}" required="true" validator="#{validatoreFatture.convalidaNomeFornitore}"  />

       

                      <h:message for="ragioneSocialeFornitore" styleClass="messaggio_errore" />

       

                  </h:panelGrid>
                  <h:outputText id="objects" style="font-weight:bold" />
              </h:panelGrid>
              <rich:suggestionbox height="200" width="200"
                                  usingSuggestObjects="true"
                                  onobjectchange="printObjectsSelected(#{rich:element('objects')}, #{rich:component('suggestion')});"
                                  suggestionAction="#{controlloGestioneFatture.suggest.autocomplete}" var="cap"
                                  for="ragioneSocialeFornitore" fetchValue="#{cap.ragioneSociale}" id="suggestion" tokens="," binding="#{controlloGestioneFatture.suggest.fornit}"  >
                  <a4j:support ajaxSingle="true" event="onselect"   >
                      <f:setPropertyActionListener  value="#{cap}"   target="#{vistaGestioneFatture.fattura.fornitore}"   />
                  </a4j:support>
                  <h:column>
                      <h:outputText value="#{cap.ragioneSociale}"  />
                  </h:column>
                  <h:column>
                      <h:outputText value="#{cap.partitaIva}"  />
                  </h:column>
              </rich:suggestionbox>

      when i Select a name of Fornitore the object Fornire ( cap)  will be set in the (vistaGestioneFatture.fattura.fornitore). It not work..

                  <a4j:support ajaxSingle="true" event="onselect"   >
                      <f:setPropertyActionListener  value="#{cap}"   target="#{vistaGestioneFatture.fattura.fornitore}"   />
                  </a4j:support>

      the object fornitore in the Fattura returned null

      where is the problem?

      help me !!