Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Create Datatable inside ManageBean  RSS feed

 
Smith Sh
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone,


I need to create, bind and access a datatable component inside a manage bean, because my requirement basically involves listing data in a single whose column names and count is determined at the run time. So does anyone know how to create and bind a datatable using Java code and display it in a JSF page.

Thanks in advance

Sumit
 
Smith Sh
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it not possible to do so....


Still waitin for replies


 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Stop waitin and start readin. You can dynamically construct a JSF view from Java code. Each of the JSF elements in the "h" and "f" tagsets * has a corresponding Java object that may be constructed, initialized and linked into the page view.

There's a fairly good introduction to this in Kito Mann's "JSF in Action" book, although don't expect to find your code written already in there. The tag elements themselves are documented on the Sun JSF site in JavaDoc form.

 
Smith Sh
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Tim,


Just that you could've chosen better language to reply in the first line.. ;)


I do have that book and remember using JSF components being created in the manage beans itself. Just that I wanted to be sure, coz Havent seen much examples of this thing being done for dynamic (varying number of column) data tables on the Net. So thought of checkin it out with the senior guys first as my application is still in the architctural phases.

anyways Thanks a lot for guidance
 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No offense intended. It's just that we occasionally get requests from people who want us to deliver a fully-debugged production-ready system ASAP on demand for free. We're here to help, but we don't get paid for it.

When your income for the month has dropped to the point where it won't even pay the Internet bill and you discover that the monsoons have made your roof rot and sag for an estimated repair cost that exceeds a Kolkota call-center employee's annual salary while you're being told that you're not needed because some chap in Bangalore has underbid you by an order of magnitude and that chap then turns around and expects to have the solution handed to him because he actually doesn't have the skill and experience to do the work himself - well, it does hit a nerve sometimes. And I'm a naturally sarky person anyway.

Still, we are here to help. At least until they cut off my Internet service due to non-payment.

And yes, you're on the right track.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!