Note that there are some explanatory texts on larger screens.

plurals
  1. POCreate inputtext dynamically
    primarykey
    data
    text
    <p>I have the next question!</p> <p>I want to create inputtext dynamically from my backing bean, they would be inside of the a tabs also dynamic created which will be constructed in execution time.</p> <p>I manage to add the components dynamically using the <code>input</code> classes corresponding.</p> <p>But I have not manage to add the value tag to the component, a <code>valueExpresion</code> language which binds the value to the <code>managedBean</code> itself.</p> <p>I have found some code which I can summerize like this.</p> <pre><code> @ManagedBean @ViewScoped public MyManagedBean(){ private TabView tabsi; HtmlOutputLabel hol = new HtmlOutputLabel(); InputText txt2 = new InputText(); private String value; /* getter and setters */ public void MyManagedBean{ tabsi = new TabView(); Tab tab1 = new Tab(); tab1.setTitle("Tab1"); Tab tab2 = new Tab(); tab2.setTitle("Tab2"); tabsi.getChildren().add(tab1); tabsi.getChildren().add(tab2); hol.setValue("label"); hol.setStyleClass("label"); txt2.setValueExpression("value", TestController.getExpression("#{myManagedBean.value}")); txt2.setValue(value); tab1.getChildren().add(hol); tab1.getChildren().add(txt2); } public static ValueExpression getExpression(String expression) { FacesContext fc = FacesContext.getCurrentInstance(); ELContext ctx = fc.getELContext(); ExpressionFactory factory = fc.getApplication().getExpressionFactory(); return factory.createValueExpression(ctx, expression, Object.class); } public void test1() { System.out.println(value); } } </code></pre> <p>I successfully manage to build the components but I can not bind it to set the <code>ValueExpression</code>. When I call the test1 function from a button it print <code>null</code></p> <p>How can I bind the value to the <code>ManagedBean</code>???</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload