-
1. Re: RF4: problem with rich:orderingList and converter
michpetrov May 14, 2013 6:18 AM (in response to alsha)I think the #{object} is null by the time the expression evaluates (because the list has already been generated). I'm not sure why it works that way.
Anyway, you can use <a4j:param> instead of <f:setPropertyActionListener>.
-
2. Re: RF4: problem with rich:orderingList and converter
alsha May 14, 2013 9:21 AM (in response to michpetrov)Hi Michal,
thanks for your help. Unfortunately, <a4j:param> does not work - setter in java bean is not getting called at all (when link is clicked).
Greetings,
Alexey
-
3. Re: RF4: problem with rich:orderingList and converter
michpetrov May 14, 2013 9:43 AM (in response to alsha)I only changed this part:
<a4j:commandLink value="#{object.name}" execute="@this"> <a4j:param value="#{object}" assignTo="#{bean.selectedObject}" /> </a4j:commandLink>
and it works. What is the scope of your bean?
-
4. Re: RF4: problem with rich:orderingList and converter
alsha May 14, 2013 9:48 AM (in response to michpetrov)I use Apache Orchestra's conversation scope.
-
5. Re: RF4: problem with rich:orderingList and converter
michpetrov May 15, 2013 7:33 AM (in response to alsha)Can you show me the bean?
One thing that you're doing is that you are converting the objects from the bean to the list but you're not using the convertor to revert the object back when you send it to the bean. I missed that, but if you were trying to set a variable with something that has different type you should see an exception in the console.
-
6. Re: RF4: problem with rich:orderingList and converter
alsha May 15, 2013 8:00 AM (in response to michpetrov)The bean has too much presentation logic, which is nonrelevant to this case.
Actually I used a converter for a4j:param (the same as with
rich:orderingList
). Without converter I am getting Exception during render phase.The point is: converter methods are not called, after commandLink was clicked, and the setter-method in java bean is not called as well.
-
7. Re: RF4: problem with rich:orderingList and converter
alsha May 15, 2013 8:06 AM (in response to michpetrov)By the way, i have a workaround for the problem, which looks ugly, but works for me.
<rich:orderingList value="#{bean.objects}" var="object" converter="someConverter"> <rich:column> <f:facet name="header"> <h:outputText value="Objects" /> </f:facet> <a4j:outputPanel onclick="_js_#{object.id}()"> <h:outputText value="#{object.name}" /> </a4j:outputPanel> </rich:column> </rich:orderingList> <a4j:repeat value="#{bean.objects}" var="object"> <a4j:jsFunction name="_js_#{object.id}"> <f:setPropertyActionListener value="#{object}" target="#{bean.selectedObject}" /> </a4j:jsFunction> </a4j:repeat>