-
1. Re: suggestionbox and valuechangelistener
ilya_shaikovsky Oct 28, 2009 6:26 AM (in response to faffinito)onchange on input happens after you just loosing focus with changing input - so it happens when you clicking in popup and before suggestion actually replaces the value. use onselect of suggestion box to send the request after selection occurs.
-
2. Re: suggestionbox and valuechangelistener
faffinito Oct 28, 2009 7:14 AM (in response to faffinito)Using "onselect" and "onblur" made absolutely no effect. The backing bean was not called.
-
3. Re: suggestionbox and valuechangelistener
ilya_shaikovsky Oct 28, 2009 7:57 AM (in response to faffinito)I meant onselect on suggestion box component
-
4. Re: suggestionbox and valuechangelistener
faffinito Oct 28, 2009 8:07 AM (in response to faffinito)Do you mean:
<a:region renderRegionOnly="true"> <h:inputText id="resCity" required="true" size="38" maxlength="50" value="#{personHome.instance.resCity}" converter="cityConverter" valueChangeListener="#personaction.choseresCity}" reRender="resZipCode"> </h:inputText> <rich:suggestionbox height="200" width="600" selfRendered="true" for="resCity" suggestionAction="#{cityList.suggest}" var="_city" fetchValue="#{_city.name}" onselect="submit()"> <h:column> <h:outputText value="#{_city.name} (#{_city.province.name})" /> </h:column> </rich:suggestionbox> </a:region>
In this way, the backing bean is not called but the completion on the suggestionbox is ok. -
5. Re: suggestionbox and valuechangelistener
ilya_shaikovsky Oct 28, 2009 8:14 AM (in response to faffinito)you mean that just listener not called? What about messages.. maybe some risen?
-
6. Re: suggestionbox and valuechangelistener
faffinito Oct 28, 2009 8:52 AM (in response to faffinito)Just like nothing was happening.
-
7. Re: suggestionbox and valuechangelistener
ilya_shaikovsky Oct 28, 2009 9:47 AM (in response to faffinito)I've checked with almost the same code but for another case using support component like there: http://www.jboss.org/community/wiki/RichFacesSuggestionGettingAdditionalProperties
and it works.. -
8. Re: suggestionbox and valuechangelistener
faffinito Oct 28, 2009 10:40 AM (in response to faffinito)Please could you post the code you used? Or simply comment the differences between mine and yours.
Thanks! -
9. Re: suggestionbox and valuechangelistener
faffinito Oct 29, 2009 7:50 AM (in response to faffinito)Any other idea?
-
10. Re: suggestionbox and valuechangelistener
nbelaevski Oct 31, 2009 9:46 AM (in response to faffinito)You can replace "submit()" with <a4j:support> tag.
-
11. Re: suggestionbox and valuechangelistener
faffinito Nov 3, 2009 5:33 AM (in response to faffinito)I'm still doing some trials.
I've been trying adding a <f:setPropertyActionListener> but I still don't get any result:<a:region renderRegionOnly="true" > <h:inputText id="resCity" required="true" size="38" maxlength="50" value="#{personHome.instance.resCity}" converter="cityConverter" valueChangeListener="#personaction.choseresCity}" reRender="resZipCode" /> <rich:suggestionbox height="200" width="600" selfRendered="true" for="resCity" suggestionAction="#{cityList.suggest}" var="_city" fetchValue="#{_city.name}" onselect="submit()"> <h:column> <h:outputText value="#{_city.name} (#{_city.province.name})" /> </h:column> <a:support event="onselect" action="#{personaction.printsomething}"> <f:setPropertyActionListener value="#{_city.name}" target="#{personaction.test}" /> </a:support> </rich:suggestionbox> </a:region>
And my backing bean is:@Name("personaction") public class PersonActionBean { private String test; public void setTest(String testt){ this.test=testt; System.out.println("PROVAABBBBBBBBBBBBB"); } public String getTest(){ return this.test; } public void printsomething() { System.out.println("PROVAAAAAAAAAAAAAA"); } }
Any suggestion? -
12. Re: suggestionbox and valuechangelistener
faffinito Nov 3, 2009 5:43 AM (in response to faffinito)Sorry, this is the xml page fragment:
<s:decorate id="resCityField" template="layout/edit.xhtml" rendered="#{!personaction.abroad}"> <ui:define name="label">Comune</ui:define> <a:region renderRegionOnly="true" > <h:inputText id="resCity" required="true" size="38" maxlength="50" value="#{personHome.instance.resCity}" converter="cityConverter"/> <rich:suggestionbox height="200" width="600" selfRendered="true" for="resCity" suggestionAction="#{cityList.suggest}" var="_city" fetchValue="#{_city.name}" > <h:column> <h:outputText value="#{_city.name} (#{_city.province.name})" /> </h:column> <a:support event="onselect" action="#{personaction.printsomething}"> <f:setPropertyActionListener value="#{_city.name}" target="#{personaction.test}" /> </a:support> </rich:suggestionbox> </a:region> </s:decorate>
-
13. Re: suggestionbox and valuechangelistener
faffinito Nov 3, 2009 5:46 AM (in response to faffinito)ok. now it works :-)
don't ask me why!