This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JSF and the fly likes Dynamic Table using PanelGrid/PanelGroup Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Dynamic Table using PanelGrid/PanelGroup" Watch "Dynamic Table using PanelGrid/PanelGroup" New topic
Author

Dynamic Table using PanelGrid/PanelGroup

Irfan Kapadiya
Greenhorn

Joined: Jan 28, 2011
Posts: 3
Hi All,

I have dynamically created panel grid using below code but I am not able to set colsapn to panelGroup component.I have attached image of table format which I required to implement in my project.


HtmlPanelGrid mainGrid=new HtmlPanelGrid();
mainGrid.setColumns(1);
mainGrid.setWidth("100%");
mainGrid.setBorder(1);
HtmlPanelGrid innerGrid=new HtmlPanelGrid();
innerGrid.setColumns(4);
innerGrid.setBorder(1);
HtmlOutputLabel srLabel=new HtmlOutputLabel();
srLabel.setValue("sr No");
innerGrid.getChildren().add(srLabel);
HtmlPanelGroup panelGroup=new HtmlPanelGroup();
panelGroup.setColspan(2);
HtmlOutputLabel panelGroupLabel=new HtmlOutputLabel();
panelGroupLabel.setValue("Date");
panelGroup.getChildren().add(panelGroupLabel);
HtmlPanelGrid groupGrid=new HtmlPanelGrid();
groupGrid.setColumns(2);
HtmlOutputLabel createdDtLabel=new HtmlOutputLabel();
createdDtLabel.setValue("created dt");
groupGrid.getChildren().add(createdDtLabel);

HtmlOutputLabel updatedDate=new HtmlOutputLabel();
updatedDate.setValue("Updated dt");
groupGrid.getChildren().add(updatedDate);
panelGroup.getChildren().add(groupGrid);
innerGrid.getChildren().add(panelGroup);

HtmlOutputLabel holidayDesc=new HtmlOutputLabel();
holidayDesc.setValue("holiday desc");
innerGrid.getChildren().add(holidayDesc);



Please help.

Thanks & Regards,
Irfan



[Thumbnail for SampleTable.jpg]

 
Consider Paul's rocket mass heater.
 
subject: Dynamic Table using PanelGrid/PanelGroup
 
Similar Threads
h:panelGrid with Attribute value
Dynamic UI generation problem while opening popup
how to bind value attribute inside another component binding attribute
box layout using HtmlPanelGroup
How to get Values out of dynamic created panel