-
1. Re: Migrate rich:suggestionBox to rich:autocomplete problem
michpetrov Sep 16, 2015 10:05 AM (in response to djschorn)I don't see a problem (other than target.previousElementSibling being null. There is a bug in 4.5.7 that makes the jsFunction execute twice, which is the opposite of your problem but you can still try updating to 4.5.9. If that doesn't work can you put together a reproducer?
I don't understand the purpose of the function, you can save the string directly to the bean. Or you can use rich:select which can also work as autocomplete.
-
2. Re: Migrate rich:suggestionBox to rich:autocomplete problem
djschorn Sep 16, 2015 10:51 AM (in response to michpetrov)I tried with the version 4.5.9 => no effect.
I don't see a problem (other than target.previousElementSibling being null.
The method updateVal is called because the "onbegin" alert is displayed.
I don't understand the purpose of the function, you can save the string directly to the bean.
I want to update a managed bean attribute on a "onselectitem" event. I found the solution in this post (https://developer.jboss.org/message/801870#801870).
Or you can use rich:select which can also work as autocomplete.
I try with rich:select, but it doesn't work too. Furthermore, I don't think I would be able to have such smart presentation (rich:column, ...) with a rich:select element.
(to continue) my investigation :
When I put a break point in the action and actionListener method (on server side), these methods are not called.
I really think that I missed something during the migration...
Have you a systematic method to find why a managed bean is not called by the client ?
If that doesn't work can you put together a reproducer?
It will be hard to reduce this situation to a short exemple, but I will try to make one.
-
3. Re: Migrate rich:suggestionBox to rich:autocomplete problem
michpetrov Sep 17, 2015 7:37 AM (in response to djschorn)org.richfaces.renderkit.AjaxCommandRendererBase.dodDecode() should queue in an ActionEvent, after that javax.faces.UICommand.broadcast() will trigger both the actionListener and action. You can start there. One thing that would prevent the action from executing is if the jsFunction wasn't rendered but I don't assume that's the case.
-
4. Re: Migrate rich:suggestionBox to rich:autocomplete problem
djschorn Sep 17, 2015 9:48 AM (in response to michpetrov)Thanks for your help.
I found a 1st problem
the javax.faces.SEPARATOR_CHAR value was set to "_". I changed to "-" , now my managed bean is called.
I saw in a forum that "_" character could make some trouble in the generating ID process.
But I'm still havng a problem with the jsFunction.
<a4j:jsFunction
name="updateVal"
onerror="alert('error')"
oncomplete="alert('end')"
render="panelViewStation">
<a4j:param name="val" assignTo="#{searchController.searchStationController.stationId}"/>
</a4j:jsFunction>
The "oncomplete" alert is now displayed, but the stationId is not assigned in the managed bean.
Thanks.