Win a copy of Bad Programming Practices 101 (e-book) this week in the Beginning Java forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JSF dataTable issue  RSS feed

 
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI All,

I want to display data using the h:dataTable tags in JSF
The data I am displaying has to be in a format like this:

Name: XXXX
ID: 8989
Age: 32

I have seen several examples on the web that tell you how to display the
data like this:

Name ID Age
XXX 8989 32

Since the dataTable tag only has a sub tag h:column and NO h:row I am having issues with this. Is there a better way to do this? I have implemented the first format I mentioned using h:datable and h:column, so first I just write out all the column headers in column 1 and then I write out all the values in column2. The issue I am facing is that when one of the values is blank the next value gets printed in its place and the data appears wrong, this is really a formatting issue. When data is blank it should leave space for it and then print the next value in the next row. Hope I am making sense, any thoughts will be much appreciated.

Is there a better way to do this maybe by not using h:dataTable (I am using JSF ), is my approach correct?
Regards.
 
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
similar post can be find http://www.coderanch.com/t/425459/JSF/java/JSF-datatable
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
it will help you


<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>

<t:datatable> tag help you
 
nitin pokhriyal
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

pavan devabhakthuni wrote:hi
it will help you


<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>

<t:datatable> tag help you



you need "newspaperOrientation" attribute but if your project using using tomahawk then only you can use this tag.
 
Meghna Bhardwaj
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Nitin for pointing me to the other post about the same issue. i am not using Tomahawk, also the code I currently have is like so. The first column just writes out labels for the column names and the second column the values.

 
nitin pokhriyal
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
either you have to create new datatable or bind datatable generate columns using tags.. HTMLColumn and HTMLDataTable.
 
Something must be done about this. Let's start by reading this tiny ad:
Why should you try IntelliJ IDEA ?
https://coderanch.com/wiki/696337/IntelliJ-IDEA
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!