1
votes

Working with the next table, I am not able to fire the listener when I select a row clicking the checkbox. Does somebody know what I am doing wrong?

Thanks!

<p:dataTable
    var="department" value="#{departmentCtrl.departmentTable}"
    selection="#{departmentCtrl.departmentList}">

    <p:ajax event="rowSelectCheckbox" listener="#{departmentCtrl.departmentSelected}" />    

    <p:column selectionMode="multiple" /> 

    <p:column headerText="#{msgs.id}">
        <h:outputText value="#{department.id}" />
    </p:column>

    <p:column headerText="#{msgs.name}">
        <h:outputText value="#{department.name}" />
    </p:column>
</p:dataTable>


public void departmentSelected(SelectEvent event) {
    //This method never executes ¿?
}

I want to do the same as in the Checkbox Based Selection sample (http://www.primefaces.org/showcase-labs/ui/datatableRowSelectionRadioCheckbox.jsf); but working with the rowSelectCheckbox and rowUnselectcheckbox events as stated in the documentation (pg 141 of Primefaces USER’S GUIDE v3.3)

1
the event rowSelectCheckbox looks unfamiliar, are you sure it's a valid event type? - kostja
Is your listener working when using a rowSelect event? - kostja
(For clarification, I've edited my post) - JLLMNCHR
I see. unfortunately, the documentation is very patchy and the visible showcase code was on more than one occasion NOT the real code used for the example. My best guess would be to checkout the PF source from here : code.google.com/p/primefaces/source/checkout look for yourself and go from there. Sry for not being able to provide a real solution. - kostja

1 Answers

0
votes

[SOLVED]

In the manage bean I change from:

List departmentList;

to

Department[ ] departmentList;