harto
harto

Reputation: 90493

How do I obtain the row index of a row in rich:dataTable?

I'm trying to output the row index for each row in a rich:dataTable. It looks like the stateVar attribute would do this, but I can't figure out how to use it.

The reference documentation for this is hopeless:

The attribute provides access to a component state on the client side

Simply outputting the state variable yields "org.ajax4jsf.component.SequenceDataAdaptor$1@f63387". I had a quick look around the web for the source, but had no luck.

Does anyone know which property of the dataTable will give me the row index?

Upvotes: 1

Views: 3182

Answers (1)

Bozho
Bozho

Reputation: 597106

What you need is the rowKeyVar attribute.

Upvotes: 3

Related Questions