Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes JSF and the fly likes hOW to give if condition in jsf data table. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "hOW to give if condition in jsf data table." Watch "hOW to give if condition in jsf data table." New topic
Author

hOW to give if condition in jsf data table.

Jenifer Rajakumar
Ranch Hand

Joined: Oct 31, 2013
Posts: 34
Hi

Iam trying to give some condition, depends on that data-table wants to display the data. Please guide me. i kept system.out.println to check it is comming inside my addAction(), it is comming



new.xhtml


NameBean.java


NameBean.java


Out Put


K. Tsang
Bartender

Joined: Sep 13, 2007
Posts: 2234
    
    7

First in your addAction() method, you using the wrong checking (== vs equals()).

I see in your data table, the header part is some what a form and the results in the body of the table.

Instead of laying out the components like you have, I suggest you move that form in the header part outside the data table, create a search button to update the data table.

Since you are using primefaces, there is "rendered" attribute you can use.


K. Tsang JavaRanch SCJP5 SCJD/OCM-JD OCPJP7 OCPWCD5
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: hOW to give if condition in jsf data table.
 
Similar Threads
Primefaces: How to insert an object attributes on a PanelGrid?
Uncaught exception created in one of the service methods of the servlet Faces Servlet in application
Error-Target Unreachable, identifier 'Sender' resolved to null
Row Actions on DataTable