You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Elam Daly <el...@gmail.com> on 2006/04/19 19:36:33 UTC
Adding Children and Unexpected Results
Hi all,
I have a booleanCheckbox, which has a valueChangeListener wired to one of my
beans. When the box is checked and therefore true, I create an
HtmlPanelGrid and add it to the component tree in the method that handles
the ValueChangeEvent. That works fine, the table is added and shows on the
page.
Now when the user sets the checkbox to false, the valueChangeEvent is never
registered. My application simply returns to the beginning page of the
application. If I then select the page where the checkbox is, it's still
set to true. So if I then click it again, the change is registered
properly.
I can only conclude from this that altering the component tree is somehow
affecting my navigation/application. Is this true? Any insight is
appreciated.
Here is the relevant code that adds the child to the component tree:
UIOutput out = null;
for(int k=0;k<4;k++) {
col = new UIColumn();
out = new UIOutput();
ValueBinding vb = FacesContext.getCurrentInstance
().getApplication().createValueBinding("#{t["+k+"]}");
out.setValueBinding("value",vb);
col.getChildren().add(out);
this.punchesGrid.getChildren().add(col);
}
UIComponent uic = FacesContext.getCurrentInstance
().getViewRoot().findComponent("tclock:tab3:rightSide");
uic.getChildren().add(this.punchesGrid);