This has to be a dumb question, but I can’t seem to find the right keywords to google on: I have an action listener that can receive an event from any one of multiple checkboxes that were all generated from the same line of jsp in a dataTable. How can I tell from the action listener which one issued the event?
In particular, I need the index of the component so I can map it to an ordered list in the model. I know I can get the UIComponent object, and from there I can get the client ID of the component. And knowing that the client ID has the component’s index embedded in it, yes I could do the sleazy thing, and parse the index from the client ID. But I know that would be a horrible, fragile and unmaintainable hack.
What’s the right way to do this?
Using the DataTables
varattribute, you should be able to do thisbean:
Edit: The binding variable of your datatable should have the method
getRowIndex();. That should give you the index of the record that caused the event in the table. I’m referencing an ICEfaces project, so I apologize if that isn’t correct. Let me know, thx.