This week's book giveaway is in the Design and Architecture forum.
We're giving away four copies of Communication Patterns: A Guide for Developers and Architects and have Jacqui Read on-line!
See this thread for details.
  • 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Please HELP me. How To Hard Code Values in Each Row of a dataTable?

 
Ranch Hand
Posts: 1309
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am working on a datatable, each row must have a checkbox.

I want to hard code some value in the datatable; therefore, I only "bind" the checkbox part of the table. As to the values in each row, I am not using the "binding".

My code does not display right. I do not have a checkbox for each row. Besides, all the hard-coded values get displayed three times. Here is my code:


[ August 29, 2005: Message edited by: JiaPei Jen ]
 
Ranch Hand
Posts: 1400
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Don't hard code this way, I would rather suggest you to hard the value in the backing bean collection object [holding the value for your datatable].
 
JiaPei Jen
Ranch Hand
Posts: 1309
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to set values of a datatable. I am new to the JSF and please help me.

1. Do I set it correctly (see below)?
2. I have to hard code some data in the dataTable that I create. How do I do it (i.e. how do I modify the code shown below)?

My presentation JSP looks like:


The personnelList is the "managed bean". And the personnel is an ArrayList.

I have a Java class that loads data into this ArrayList "personnel". The Java class is called Table:


The PersonnelBean is a Java bean that get and set the attributes:
 
"I know this defies the law of gravity... but I never studied law." -B. Bunny Defiant tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic