Olá, pessoal. Uso o netbeans 5.5 + VWP e minha dúvida é quanto a adicionar um componente dinamicamente. Vi um post e copiei um código de lá para o meu projeto.
public void prerender() {
if(getSessionBean1().isCreateComponent()) {
javax.faces.component.UIViewRoot root = this.getFacesContext().getViewRoot();
UIComponent form = root.findComponent("form1");
if (form==null)
form = new Form();
List children = form.getChildren();
// Children is a mutable list so just add your custom fields...
TextField tf_test = new TextField();
tf_test.setId("textField1");
tf_test.setText("Hello Components Tree!!");
tf_test.setStyle("height: 200px; left: 72px; top: 72px; position: absolute; width: 48px");
tf_test.setVisible(true);
tf_test.setRendered(true);
children.add(tf_test);
}
}