1 2 Previous Next 20 Replies Latest reply on Dec 18, 2007 6:59 PM by cyberanto

    Suggestionbox: Setting the selected row/value in serverside

    Martin Taal Newbie

      Hi,
      I am having trouble getting the selected row/value of a suggestionbox in a serverside bean. There are several posts about this on the forum. In one of the posts, a solution using the onselect event was proposed by ilya_shaikovsky. I tried this but I only get null values send to the server (when the onselect event fires). Is there something wrong with my code (see below)?
      btw, I use seam 2.0ga and the richfaces version distributed with seam 2.0ga.

      Thanks!

      gr. Martin

      <s:decorate id="bookAuthorDecoration"
       template="/templates/facelets/edit.xhtml">
       <ui:define name="label">#{messages['Book.author']}</ui:define>
       <h:panelGrid columns="3">
       <h:inputText id="bookAuthor"
       value="#{entityHome.instance.author.Identifier}" size="25"
       maxlength="50" disabled="#{entityHome.formMode=='delete'}"
       readonly="#{entityHome.formMode=='delete'}"
       onfocus="this.select();"
       required="#{model.Book.author.required}">
       </h:inputText>
       <rich:spacer width="5"/>
       <h:outputText value="#{entityHome.instance.author.Description}" />
       </h:panelGrid>
       <rich:suggestionbox id="bookAuthorSuggestion" for="bookAuthor"
       ajaxSingle="true" selfRendered="true"
       focus="bookISBN" eventsQueue="bookAuthorSuggestion"
       suggestionAction="#{suggestion.get('bookAuthorSuggestion', entityHome.instance, 'author', 'name', '100').autoComplete}"
       var="row" fetchValue="#{row.Identifier}" minChars="2">
       <h:column>
       <h:outputText value="#{row.Title}" />
       </h:column>
       <a4j:support event="onselect" actionListener="#{entityHome.doIt}" reRender="bookAuthorDecoration">
       <f:setPropertyActionListener value="#{row.Title}"
       target="#{entityHome.suggestionValue}" />
       </a4j:support>
       </rich:suggestionbox>
       </s:decorate>
      


        1 2 Previous Next