table filter column

UI Components for JSF
Post Reply
SamoFleura
Posts: 19
Joined: 15 Jun 2012, 12:45

15 Jul 2012, 15:43

person helps me to filter my tables I work with jsf and netbeanse

I want to display some columns of my table, and when I want to show the other column I click a button and displays the other columns.
thank you in advance. :roll:

SamoFleura
Posts: 19
Joined: 15 Jun 2012, 12:45

16 Jul 2012, 23:25

:cry:

vineet
Posts: 387
Joined: 14 Oct 2011, 23:40

17 Jul 2012, 03:40

You can either use dynamic columns . refer the showcase example . or you can use rendered attribute of the p:column . Set rendered = false for columns you dont want to display and on click of the button update the datatable with ajax like

<p:commandbutton actionlistener = "bean.somemethod" update = tableid . set the rendered = true/false depending on columns you want to render .

User avatar
sudheer
PrimeFaces Core Developer
Posts: 4345
Joined: 16 Oct 2011, 19:19
Location: Singapore

17 Jul 2012, 06:50

If we use column rendering then table width will be increased .If we use dynamic columns then table width is constant so column width will vary.So dynamic column is better one and we need to add logic like onclick on button should add column values in backing bean not like adding columns using inputtext from showcase .
Author,Speaker
https://twitter.com/sudheerjonna
Github: https://github.com/sudheerj
Website http://sudheerjonna.com/

___________________
Sudheer Jonna

SamoFleura
Posts: 19
Joined: 15 Jun 2012, 12:45

19 Jul 2012, 12:39

thank you :P

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 22 guests