-
1. Re: Using Two SuggestionBoxes on the same form
ilya_shaikovsky Jul 4, 2007 6:52 AM (in response to heather321)Could not reproduce under RF 3.0.2 SNAPSHOT
-
2. Re: Using Two SuggestionBoxes on the same form
shino Aug 26, 2010 8:54 AM (in response to heather321)I know, the post is really old, but I had the same problem and maybe this will help someone:
two inputfields (zip code and city), two suggestionboxes and each suggestionbox providing values for both inputfields (an a4j:support onselect would set the backing bean value for the other field and rerender it).
Selecting a suggestion from the zip-code suggestionbox would kind of disable* the city suggestionbox and vice versa.
*no request was sent to the server when typing in the inputfields.
I was able to get it working agagin by changing the rerender parameter of the a4j:support onselect for the suggestioboxes: instead of only rerending the other input field (zip or city), I also included the id of the suggestionbox for the other inputfield.
<h:inputText id="zip" value="#{address.zip}"/> <h:inputText id="city" value="#{address.city}"/> <rich:suggestionBox id="zipSuggestionBox" for="zip" fetchValue="#{suggestionItem.zip}" var="suggestionItem" suggestionActoin="#{suggestionHandler.querySuggestionsForZip}" minChars="#{suggestionHandler.minCharsZip}> <a4j:support event="onselect" ajaxSingle="true" immediate="true" reRender="city,citySuggestionBox"> <f:setPropertyActionListener target="#{address.city}" value="#{suggestionItem.city}"/> </a4j:support> </rich:suggestionBox> <rich:suggestionBox id="citySuggestionBox" for="city" fetchValue="#{suggestionItem.city}" var="suggestionItem" suggestionActoin="#{suggestionHandler.querySuggestionsForCity}" minChars="#{suggestionHandler.minCharsCity}> <a4j:support event="onselect" ajaxSingle="true" immediate="true" reRender="zip,zipSuggestionBox"> <f:setPropertyActionListener target="#{address.city}" value="#{suggestionItem.city}"/> </a4j:support> </rich:suggestionBox>
Best regards
Chris