Primefaces 2.2.1
Mojarra 2.1.2
I have a sophisticated method in my jsf bean :
public void saySomething() {
log.debug("SAY SOMETHING !");
}
And a simple button in the jsf :
<p:commandButton
value="say something"
process="@this" update="@none" action="#{timetableBean.saySomething}" />
Clicking on the button, results in my simple logging :
DEBUG PhaseTracker - BEFORE PHASE INVOKE_APPLICATION 5
DEBUG TimetableBean - SAY SOMETHING !
DEBUG PhaseTracker - AFTER PHASE INVOKE_APPLICATION 5
Let's go to next simple case. When placing that identical button inside a p:dataList like this :
<p:dataList id="groupUsers2" value="#{timetableBean.group.users}" var="user" itemType="circle" style="padding:0; margin: 0;">
<p:commandButton
value="#{user.data['selected'] ? 'V' : 'X'}"
process="@this" update="@none" action="#{timetableBean.saySomething}" />
<p:commandLink value="#{user.userId} - #{user.name}" process="@this" />
</p:dataList>
Clicking on the button, results in my simple logging :
DEBUG PhaseTracker - BEFORE PHASE INVOKE_APPLICATION 5
DEBUG PhaseTracker - AFTER PHASE INVOKE_APPLICATION 5
The method of saySomething() was not called !
What did i do wrong ?
Problem solved.
Found the solution in here
In order for listener to be invoked, the components inside the p:dataList should be encapsulated with p:column
<p:dataList id="groupUsers2" value="#{timetableBean.group.users}" var="user" itemType="circle" style="padding:0; margin: 0;">
<p:column>
<p:commandButton
value="#{user.data['selected'] ? 'V' : 'X'}"
process="@this" update="@none" action="#{timetableBean.saySomething}" />
<p:commandLink value="#{user.userId} - #{user.name}" process="@this" />
</p:column>
</p:dataList>
Strange though, i didnt see this in the documentation, as it doesnt specify the p:column. Perhaps it's in the errata for primefaces 2.2.1 doc ?
Related problems here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With