File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes Initialize Data Table using Managed Bean Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Initialize Data Table using Managed Bean" Watch "Initialize Data Table using Managed Bean" New topic
Author

Initialize Data Table using Managed Bean

Ahalya
Greenhorn

Joined: Dec 22, 2004
Posts: 1
Hi,

I have a simple class like customer that has these properties:

- name, id, address, date of birth

I would like to define some <n> customer type objects in the
managed-bean and initialize a table with those objects. So when
the page is loaded it shows a table of pre-initialized customers.

Is this doable. I am new (very new) to JSF/Creator. If there is any
tutorials that point to similar tasks please point me to those.

Thanks.
Jeremy Wilson
Ranch Hand

Joined: Feb 18, 2003
Posts: 166
That is no problem at all. I would start by downloading the MyFaces example application from myfaces.apache.org. There are some very good samples there. Basically you will need a backing bean the contains a list of the objects. In the constructor of the backing bean read the customers from a data source and create the object instances.

A jsp page to display the data in the managed bean.

the faces config xml file to define the backing bean, navigation actions to the jsp.

Hope this helps as a starter.


Jeremy Wilson
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15286
    
    6

Welcome to Javaranch! We don't have too many rules around here but we do have a Naming Policy. Please adjust your display name accordingly. You can adjust your display name here.

Thanks.


GenRocket - A Test Data Generation Platform
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Initialize Data Table using Managed Bean
 
Similar Threads
CMP scenario
Mock question on CMR
database access pattern
How to call a JPA-Facade from a JSP
CMP maping - one to many unidirection in wl7.0