Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Dynamically generate jsf components

 
Gopu Akraju
Ranch Hand
Posts: 242
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 242
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 242
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 242
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there anyway that I can display my list horizontally? Thanks.

I also need some help in binding these beans..Thanks.
 
Ravi Mirani
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Add a property layout="pageDirection" to h:selectOneMenu tag.
 
Gopu Akraju
Ranch Hand
Posts: 242
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic