Hello Primefaces Guys,
I have a datatable with check boxes in each row. On first display, i want some rows to be selected automatically. I tried using the selection attribute but apparently its value is never read It seems to be used for storing selected items after submit.
Is there a way to do so ?
Thanks in advance.
Display datatable with auto selected checkbox
im not sure if this is the answer you are loolink for, but i try to help.
auftrag should be a class and checkvalue should have a getter and a setter from type boolen. the value of checkvalue you can modify in your code.
i hope this was helpfully
Code: Select all
...
<p:column styleClass="w30Center" sortBy="#{auftrag.checkvalue}">
<f:facet name="header">
<h:outputText value="Some text:" />
</f:facet>
<h:selectBooleanCheckbox value="#{auftrag.checkvalue}" valueChangeListener="#{a_bean.valueChangeListener}"/>
</p:column>
...
i hope this was helpfully
-
- Prime
- Posts: 18616
- Joined: 05 Jan 2009, 00:21
- Location: Cybertron
- Contact:
If you populate your selection, the checkboxes corresponding to those rows will be checked on initial display. Make sure to override equals and hashcode.
http://www.primefaces.org/showcase/ui/d ... eckbox.jsf
http://www.primefaces.org/showcase/ui/d ... eckbox.jsf
-
- Posts: 5
- Joined: 09 Jan 2011, 05:17
hello, could you share you code? i have the save problem, but couldn't fix it, please help me, thanks.
-
- Information
-
Who is online
Users browsing this forum: No registered users and 45 guests