-
1. Re: suggestionbox with actionparam
ilya_shaikovsky Feb 18, 2010 9:27 AM (in response to arkmobile)if you see correct output there
<h:outputText id="origSuggestCity" value="#{_origin.city}, #{_origin.countryName}" />
then the next code
<a:actionparam name="origCountry" value="#{_origin.countryName}" assignTo="#{quoteManager.originCountry}" />
should also works fine.. which RF used?
-
2. Re: suggestionbox with actionparam
arkmobile Feb 18, 2010 9:43 AM (in response to ilya_shaikovsky)I'm running on verson 3.3.1.GA.
This works:
<h:outputText id="origSuggestCity" value="#{_origin.city}, #{_origin.countryName}" />
This works:
<a:actionparam name="origCountry" value="United States" assignTo="#{quoteManager.originCountry}" />
but this doesn't work:
<a:actionparam name="origCountry" value="#{_origin.countryName}" assignTo="#{quoteManager.originCountry}" />
-
3. Re: suggestionbox with actionparam
ilya_shaikovsky Feb 18, 2010 10:07 AM (in response to arkmobile)please check with 3.3.3CR1 -
4. Re: suggestionbox with actionparam
arkmobile Feb 18, 2010 10:29 AM (in response to ilya_shaikovsky)I upgraded to 3.3.3.CR1 and it still returns an empty value. Any additional thoughts? -
5. Re: suggestionbox with actionparam
arkmobile Feb 18, 2010 3:23 PM (in response to arkmobile)Does anyone have this working or is this a bug?
-
6. Re: suggestionbox with actionparam
ilya_shaikovsky Feb 19, 2010 6:06 AM (in response to arkmobile)I'm really sorry for pointing you to wrong direction from the beggining.
As suggestionBox not based on repeat component for iteration data it has no feature or proper encoding the support for every row with concrete parameters for the row. So this problem really exist as actionparam not properly output to the client side in this case.
But the good news is that simple solution exist:
<a4j:support event="onselect" reRender="out"> <f:setPropertyActionListener target="#{capitalsBean.currentStateFilterValue}" value="#{result.state}"> </f:setPropertyActionListener> </a4j:support>
wil works just as you need. -
7. Re: suggestionbox with actionparam
arkmobile Feb 19, 2010 10:41 AM (in response to ilya_shaikovsky)Thank you very much, this works!! Here is the final snippit of code that worked for me.
<a4j:support event="onselect" reRender="out"> <f:setPropertyActionListener target="#{quoteManager.originCountry}" value="#{_origin.country}"> </f:setPropertyActionListener> </a4j:support>
I'm curious if there is some way to use the actionparam IF i decided to change the format of my data (possibly using the @DataModel annotaion or something?) Is there some resource which explains how the rich:suggestionBox suggestionAction converts the List<Enity>? I think i read that it uses JSON somehow to convert the entity into xml? Anyway, thanks again for solving my problem.
-
8. Re: suggestionbox with actionparam
ibrewster Mar 26, 2010 7:04 AM (in response to arkmobile)I've used this and it works fine, however I have an additional issue with form submission as described here [https://community.jboss.org/message/62086#62086]
I basically have a suggestion box to select a country on a form that has a number of other fields, some of which are mandatory, although the country is not. On selecting a suggestion box entry and pressing enter the form is submitted which causes validation errors because of my lack of required field values. My selected suggestion box value is not saved to the bean although the value is displayed in the <h:inputText> field. I can't trap onselect because I need it for the propertyActionListener. My code is here
{code:xml}
<s:decorate id="nationalityField" template="/layout/edit.xhtml">
<ui:define name="label">
<h:outputText value="#{commonText.nationality}"/>
</ui:define>
<h:inputText id="nationality"
title="#{bookingText['maintainTraveller.nationalityTooltip']}"
value="#{travellerHome.instance.person.countryName}"
style="width:250px">
</h:inputText>
<rich:suggestionbox height="250" width="250"
suggestionAction="#{countryList.suggestions}"
var="_country"
for="nationality"
fetchValue="#{_country.name}"
tokens=",">
<h:column>
<h:outputText value="#{_country.name}"/>
</h:column>
<a4j:support event="onselect" for="nationality">
<f:setPropertyActionListener target="#{travellerHome.instance.person.country}"
value="#{_country}"/>
</a4j:support>
</rich:suggestionbox>
</s:decorate>{code}
Anyone got suggestions?
Thanks
Ian