permaculture playing cards*
The moose likes JSF and the fly likes How to get  Values out of dynamic created panel Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "How to get  Values out of dynamic created panel" Watch "How to get  Values out of dynamic created panel" New topic
Author

How to get Values out of dynamic created panel

Andy Egli
Greenhorn

Joined: Nov 21, 2006
Posts: 3
Hi all




public class VehicleCharacteristicBean {


private HtmlPanelGrid panelGrid;

public void init(){
panelGrid=new HtmlPanelGrid();
panelGrid.setColumns(2);
createSelectPanel();
}

public VehicleCharacteristicBean(){
init();
}

public HtmlPanelGrid getPanel(){

return panelGrid;
}

public void setPanel(HtmlPanelGrid _panelGrid){
this.panelGrid=_panelGrid;

}

public void change(ActionEvent event) {
UIComponent comp = event.getComponent();
}

public void createSelectPanel(){

ProductFacade facade= new ProductFacadeImpl();
List characteristics=facade.getProductInstanceData(1);

Iterator it=characteristics.iterator();

while(it.hasNext()){

Characteristic current=(Characteristic)it.next();
HtmlOutputLabel label=new HtmlOutputLabel();
label.setValue(current.getLabel());
HtmlSelectOneMenu menu= new HtmlSelectOneMenu();
menu.setId(current.getLabel());

UISelectItems items = new UISelectItems();
List value=current.getValues();

List s= new ArrayList();
s.add(new SelectItem("","",""));
for(int i=0; i<value.size();i++){
s.add(new SelectItem((String)value.get(i),(String)value.get(i),""));
}

items.setValue(s);
menu.getChildren().add(items);
panelGrid.getChildren().add(label);
panelGrid.getChildren().add(menu);
}


}
}
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to get Values out of dynamic created panel
 
Similar Threads
Binding, dynamic UIComponent treegeneration and display problem
populate selectOneMenu with list containing various type of object
Dynamic HtmlSelectOneMenu : How to set the selected value in dropdown?
Listener not invoked with a built HtmlSelectOneMenu component
How to get Values out of dynamic created panel