This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Journey To Enterprise Agility and have Daryl Kulak & Hong Li on-line!
See this thread for details.
Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

dataTable in JSF  RSS feed

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I am new to JSF .In my application I am using <h:dataTable> to populate a dynamic table .I have two columns "NUMBER" and "NAME".I am using the following Code ---
<h:dataTable id="dt1" value="#synergyCustomerManagementBeanHandle.result}" var="item" border="1" cellpadding="0" cellspacing="0" width="100%" bgcolor="white" >
<h:column >
<f:facet name="header" >
<hutputText value="Number" />
</f:facet>
<hutputText value="#{item.number}"></hutputText>
</h:column>
<h:column>
<f:facet name="header">
<hutputText value="Name" />
</f:facet>
<hutputText value="#{item.name}"></hutputText>
</h:column>
</h:dataTable>



NOw The problem is both the column taking the same space .but i want that the size of the two column will be 20%(NUMBER) and 80%(NAME). but how to do that because
<h:column>,<f:facet> nothing cotains property like width .

How can I do this kind of alignment?
Thanks in Advance.
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

you can use the "columnClasses" attribute of the h:dataTable Tag.
You can specify for every column one style-class.

E.g


You can specify styles for the rows as well with the "rowClasses"-Attribute

See more Examples with JSF-Datatables on http://www.j4fry.org/J4Fry_Quick_Setup_Tomcat_MyFaces_Hibernate/index.faces


---------------------
Visit http://www.j4fry.org
 
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Alexander Bell",
Please check your private messages regarding an important administrative matter.
-Ben
 
Ranch Hand
Posts: 1880
Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
DataTable in JSF
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!