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 Dynamically generate jsf components Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Dynamically generate jsf components" Watch "Dynamically generate jsf components" New topic
Author

Dynamically generate jsf components

Gopu Akraju
Ranch Hand

Joined: Jan 13, 2008
Posts: 242
Hi,
I am a beginner in java programming. I query a database and display them in a fixed set of jsf components in a jsp page.
Basically its a 8 rows table and 3 columns table. And hence I have displayed as below simply.
Each row had only 3 columns to display as below.


Now I have something new to learn. for each row in a table, there might be 4 or 8 (dynamic number) of rows and 3 columns for each row (inside) to be displayed. How to display them. Can any one show me a very simple example? I would really appreciate any help as I am getting my hands in java after a long time. Thanks.

Gopu Akraju
Ranch Hand

Joined: Jan 13, 2008
Posts: 242
Hi,
Since I didn't get any resonse, may be my query is not very clear.
Right now , I query a database and displau them as jsf components as below. (8 rows and 3 columns)
But my new query each row might contain either 1 set of 3 columns or 4 sets of 3 columns. How to dynamically include tehse data to be displayed? A small example would be very very helpful. Thanks again.
Gopu Akraju
Ranch Hand

Joined: Jan 13, 2008
Posts: 242
My list of item to be displayed in in an arrayList. I tried datable as bleow:

Initially I have just one set data for each row to be displayed as below:
lane2A is an arraylist with just one item.


now lane2A might have more than 1 tem and still items in an arraylist
I am trying as follows but the list is displayed horizontally as



How to display a horizontal list as


Thanks.
Gopu Akraju
Ranch Hand

Joined: Jan 13, 2008
Posts: 242
Is there anyway that I can display my list horizontally? Thanks.

I also need some help in binding these beans..Thanks.
Ravi Mirani
Greenhorn

Joined: Aug 09, 2011
Posts: 19
Add a property layout="pageDirection" to h:selectOneMenu tag.
Gopu Akraju
Ranch Hand

Joined: Jan 13, 2008
Posts: 242
Hi Ravi,
Thanks for your response. But I want to just display the table in a dataTable and also have to bind these beans for further manipumation.
I also tried dataList as below:


The results are still displayed as ".[HI, BYE] "
Regards
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Dynamically generate jsf components
 
Similar Threads
selectBooleanCheckbox
EL Syntax exception - javax faces el ReferenceSyntaxException
JSF datatable doubt
Special Characters '&' and ':'
Brain burp! Can't get the right Data Grid layout