So, after several days of debugging, we were eventually able to reproduce some strange interactions between the constituent components of ui:repeat , p:remoteCommand and partial state persistence in JSF, which we do not understand.
Scenario
A composite component iterates over a list of objects using ui:repeat . During each iteration, one more component is included and arguments are passed.
<ui:composition (...)> <ui:repeat var="myVar" value="#{cc.attrs.controller.someList}"> <namespace:myRemoteCommand someParam="SomeParam"/>
The included component has an autorun p:remoteCommand that calls the method using the parameters defined in the component's interface.
<ui:component (...)> <p:remoteCommand actionListener="#{someBean.someMethod(cc.attrs.someParam)}" autoRun="true" async="true" global="false">
However, when setting a breakpoint in someMethod(...) , an empty string is passed. This only happens if partial state retention is set to false .
Decision
We tried several solutions, and the following work (however, we do not understand why and cannot foresee further problems that may arise):
We can set the partial state to true .
We can change the component template to ui:include .
We can remove one or both of the component components and directly include the content.
Question
Why does JSF behave like this? What is the interaction between the composite component, ui:repeat and passing arguments, which varies depending on whether we use ui:include / partial state preservation or not?
We use Primefaces 5.3, Glassfish 4.1, Mojarra 2.2.12, Java 8.
source share