6 Replies Latest reply on Nov 19, 2010 4:02 AM by Ilya Shaikovsky

    Problem copying results from front-end into bean with setPropertyActionListener

    David Perez Newbie

      Hello guys,

       

       

      My intention is to send several String fields from a jsf page through beans to another but it is failing for me. One ot these fields is the suggestion provided by querying a database through the RichFaces suggestionBox component. It will show up to 10 suggestions and the user will select one. After that, I will click on a button to go to another jsf page to show a summary of the fields retrieved from the other page.

       

       

      The conceptBean and annotationBean beans are mapped with a scope of "request" in faces-config.xml and will carry the content of the fields name and instance. At the moment when I click on the button, the beans have no value set (I got setters for all the attributes in the beans) and I don't know why is this happening.  Do you think that there are a4j:forms, a4j:regions missing? Any ideas? Thanks a lot in advance

       

       

      I leave you here the fragment of code corresponding to my jsf for input data:

       

       

      <div class="row">

              <fieldset><h:outputText value="#{msg1.your_comment}"/>:</fieldset>

              <h:inputTextarea id="comment" value="#{annotationBean.comments}" cols="1" rows="3" />

          </div>

       

       

      <div class="row">

              <fieldset><h:outputText value="#{msg1.search_ontology}"/>:</fieldset>

                 <h:inputText value="" id="input-suggestion"/>

              <rich:suggestionbox id="suggestion" width="571" for="input-suggestion" var="result" minChars="3"

                      suggestionAction="#{actionsContainer.ontologyActions.getSuggestions}" nothingLabel="No suggestions found" zindex="99999" fetchValue="#{result.name}" oncomplete="correctSuggestionBox(); return false;" >

                      <h:column>

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

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

                      </h:column> 

                      <a4j:support ajaxSingle="true" event="onselect">

                          <f:setPropertyActionListener value="#{result.name}" target="#{conceptBean.label}" /> <!-- Save label -->

                          <f:setPropertyActionListener value="#{result.instance}" target="#{conceptBean.uri}" /> <!-- Save uri -->

                       </a4j:support>

                 </rich:suggestionbox>

          </div>

       

       

       

      This is the next page where the results must be shown:

       

       

      <a4j:outputPanel>

       

          <div class="row">

              <fieldset><h:outputText value="#{msg1.your_comment}"/>:</fieldset>

              <h:inputTextarea id="comment" value="#{annotationBean.comments}" cols="1" rows="3" disabled="true" />

          </div>

          <div class="row">

              <fieldset><h:outputText value="#{msg1.selected_concept}"/>:</fieldset>

              <div id="ontology-tree">

                  <h:outputText value="Concept #{conceptBean.uri}" />

       

                  <h:outputText value="Concept #{conceptBean.label}" />

              </div>

          </div>

       

      </a4j:outputPanel>