0 Replies Latest reply on May 20, 2009 11:59 PM by Cody Lerum

    SuggestionBox and inputText Initial Values

    Cody Lerum Apprentice

      I'm a little new to RF/JSF so forgive me if this is an obvious question. I'm using Seam 2.1.1GA and RF 3.3.1GA

      My issue is I have a page where I'm need to set an associate two entitys.

      I have the following which works great. The site list shown in suggestionbox and when clicked it sets the site object to voiceGroup

      <s:decorate template="/layout/edit.xhtml">
       <ui:define name="label">Site</ui:define>
       <h:inputText id="site_input" size="75" required="true" value="#{voiceGroup.site.name}" tabindex="1" />
       <rich:suggestionbox for="site_input" suggestionAction="#{siteUtil.searchSites}" var="_site" minChars="2" id="suggestion" width="500">
       <h:outputText value="#{_site.name} - #{_site.alias}" />
       <a:support ajaxSingle="true" event="onselect" reRender="site_input">
       <f:setPropertyActionListener value="#{_site}" target="#{voiceGroup.site}" />

      The problem is that if someone manually edits the inputText (other than it being set by the suggestionBox) they can change the voiceGroup.site.name value. I only want them to be able to select the object this page not edit the name of the site object.

      I basically need an inputText field to work with the suggestionBox which doesn't actually submit with the form.

      Is there an easy way to do this?

      Or I can leave the value off the inputText if there is a way to populate the initial value of the field.