This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Tomahawk (myfaces) tree table not able to identify the checkbox component inside valuechangelistener

Umesh Se
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I'm trying to use tomahawk(myfaces) tree table component to render a tree column of items along with checkboxes in other columns. Note that all the other columns except tree column are generated dynamically inside backing bean and checkboxes too added to the column dynamically.
All works fine until it comes to the valuechangelistener.Inside valuechangelistener if try to fetch the component id from the event, it doesn't return the correct id and instead always return the id that corresponds to the last node of tree.

Has anyone successfully used tree table to display input components? or any workaround my problem would be much appreciated.

The code where I'm adding my dynamic columns as well as checkboxes is as below.

for (int i = 0; i < roleNames.size(); i++) {

HtmlSimpleColumn column = new HtmlSimpleColumn();

// Create header
HtmlOutputText header = new HtmlOutputText();

ValueExpression valueExpression = FacesContext

// Create check box
HtmlSelectBooleanCheckbox checkbox = new HtmlSelectBooleanCheckbox();

// add the hidden input elements
HtmlInputHidden input = new HtmlInputHidden();
HtmlInputHidden input1 = new HtmlInputHidden();

// Bind changeRolePresent method in to listen to the
// role permission change

Class<?>[] parms = new Class[] { ValueChangeEvent.class };
System.out.println("Adding value change listener to permission grid");
MethodExpression valueChangeListener = FacesContext
String.class, parms);
.addValueChangeListener(new MethodExpressionValueChangeListener(

input.setValueExpression("value", valueExpression);

valueExpression = app

checkbox.setValueExpression("value", valueExpression);


In above code there will be four columns added dynamically and for each column a checkbox component is being added here. Rest JSF takes care to create checkboxes for each row of tree. But one thing that I noticed while viewing source that JSF is creating duplicate names for checkboxes in a batch of four (So for say if I had 3 rows, every row of checkboxes had same set of four ID's assigned, like ID1, ID2, ID3, ID4)

I agree. Here's the link:
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic