• Post Reply Bookmark Topic Watch Topic
  • New Topic

Identify selectone inside DataTable  RSS feed

Gabriel Beres
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

i have a datatable, which content is created programatically. At every row, there is a selectone componenent. These selectone-s have a JSF valuechangelistener attached, and when the user change the value, the valuechangelistener fires.

Since the selectone is in a datatable, i need to identify the selectone-s, based on the var attribute of the table. For example if var is a Category object. i would like to set the selectone-s id to myselect_#{category.category_id}. Then i could get this id on the valuechanged event handler, and do something with it.

The problem is when i try this:

selectone.setValueExpression("id", JSFUtils.createValueExpression("#{category.category_id}", String.class));

I bet this is not valid, because it gives me IllegalArgument exception.

Is there another way, to do what i want? (note that i use JSF 2.0)

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!