-
1. Re: rich:suggestionbox
iimirela Feb 25, 2010 4:49 AM (in response to iimirela)Hi,
I've solved my problem:
1. I changed my bean's scope to 'session'.
2. I used f:setPropertyActionListener instead of the javascript to set the value:
<a4j:region selfRendered="true">
<h:panelGrid columns = "4" cellpadding="0" cellspacing="0">
<h:inputText id="zip" readonly="true" value="#{registerBean.selectedCity.zipCode}" styleClass="shortText" />
<h:inputText id="city" styleClass="largeText" value="#{registerBean.selectedCity.name}"/>
<h:graphicImage value="/images/buttons/btn_down.gif"
onclick="#{rich:component('suggestion')}.callSuggestion(true)" />
</h:panelGrid>
<rich:suggestionbox id="suggestion" for="city" fetchValue="#{result.name}"
suggestionAction="#{registerBean.suggestedCities}"
var="result" ignoreDupResponses="true"
nothingLabel="#{pageMessages.noResultsFound}">
<h:column>
<h:outputText value="#{result.zipCode}"/>
</h:column>
<h:column>
<h:outputText value="#{result.name}"/>
</h:column>
<a4j:support event="onselect" ajaxSingle="true" reRender="zip">
<f:setPropertyActionListener value="#{result}" target="#{registerBean.selectedCity}"/>
</a4j:support>
</rich:suggestionbox>
</a4j:region>