user1629683
user1629683

Reputation:

PrimeFaces 3.5 and DataTables (multiple selection)

I am currently experiencing a lot of troubles with the new release of PrimeFaces (3.5). Here's an example piece of code:

<p:dataTable var="obj" id="objDataTable"
value="#{backingBean.objects}" rowKey="#{obj.id}"
paginator="true" paginatorAlwaysVisible="true"
paginatorPosition="top" rows="15" editable="true"
selection="#{backingBean.selectedObjects}">

<p:column styleClass="headcol" selectionMode="multiple" />

    <p:column headerText="name" sortBy="#{obj.name}"
    filterMatchMode="contains" filterBy="#{obj.name}"
    styleClass="headcol">
    <h:outputText value="#{obj.name}" />
</p:column>
</p:dataTable>

When I click the checkboxes in the rows, I can select multiple rows, not a problem there. But once you click an actual row, you lose the selection. I am experiencing more problems than this one alone, but would like to start with this problem. I am going to post the same question on the PrimeFaces forum. This could also be a duplicate of this question, but there was literally no documentation on that question so I rather ask it again.

Upvotes: 3

Views: 3307

Answers (2)

Mozquito
Mozquito

Reputation: 35

add option rowSelectMode="add" in your <p:dataTable>

Upvotes: 1

user1629683
user1629683

Reputation:

Well, since nothing came up here I'd just like to add what I was told on the PrimeFaces-forum, (which confirms Serkan's comment on the original post) , this is -despite being new- desired behaviour, and for that reason not a bug. Some additional JQuery would (and in my case probably is going to) be able to work around this feature.

Upvotes: 0

Related Questions