A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
JavaRanch
»
Java Forums
»
Java
»
JSF
Author
How to get Values out of dynamic created panel
Andy Egli
Greenhorn
Joined: Nov 21, 2006
Posts: 3
posted
Nov 21, 2006 08:01:00
0
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://ej-technologies/jprofiler
- if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
subject: How to get Values out of dynamic created panel
Similar Threads
Binding, dynamic UIComponent treegeneration and display problem
How to get Values out of dynamic created panel
Dynamic HtmlSelectOneMenu : How to set the selected value in dropdown?
populate selectOneMenu with list containing various type of object
Listener not invoked with a built HtmlSelectOneMenu component
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter