Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

Umesh Se
Posts: 1
  • 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)

With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!