You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by dushyant agarwal <ag...@yahoo.co.in> on 2008/07/22 15:58:17 UTC

[TRINIDAD]Tree table does not show correct bindings.

Hi,
I have a JSF page,that contains a tree table that shows data arriving from database via EJB.

The number columns of the tree table is dynamic. They get created at the time the page is just about to be rendered at the  After render response  phase event. 

Now the <nodeStamp >facet of the tree table contains a column containing inputText whose readInly has been st as true in the jsp. Rest of the columns get created dynamically. These other columns contain  editable  inputTexts. Their programmatically provided value binding using the setValueExpression() method of CoreInputText class. 

Now there is a radio button in the page whose auto submit is set to true. The valueChange Listener method attached to it does the following:
1.Delete all the columns of tree table: using the foolwoing code
            for(int i=0i<treeTable.getChildren.size();i++){
              i=-1;
             treeTable.getChildren.remove(treeTable.getChildren.size()-1;
}
2. Calls a method on the EJB to get a list of objects from the Database. Based on this new columns are instantiated,new inputTexts are created,Their valueBindings are provided and added to the columns. Then the columns are added to the table.

Now on changing the value of the radio buttons I talked about earlier, the value of the tree tables columns does get changed. But the value of the column in the nodeStamp facet also changes. On debugging I found that the value binding of that column's inputTexts had become equal to the last column's  inputTexts'binding that appeared in the previous view.i.e.the view that had appeared before clicking on the radio button.

I tried removing the jsp code of node stamp and then creating it afresh from the backing bean.This included removing the children of the node stamp column every time.
But I just could not get the valueBinding right.

Now is there any explanation as to how the columns should be removed so that the value bindings also get removed safely. Where can I make changes to secure the error?

Thanks,
Dushyant



      From Chandigarh to Chennai - find friends all over India. Go to http://in.promos.yahoo.com/groups/citygroups/