I'm trying to get selected row index from dataTable to my bean. Tried tons of things, none of them worked.
Here's my dataTable:
<p:dataTable rowIndexVar="k" var="item" value="#{configBean.configTable[0]}" selectionMode="single" selection="#{config.selectedList}" rowKey="#{item}">
<p:column headerText="1">
#{config.configTable[0][k]}
</p:column>
<p:column headerText="2">
#{config.configTable[1][k]}
</p:column >
<p:column headerText="3">
#{config.configTable[2][k]}
</p:column>
<p:column headerText="4">
#{config.configTable[3][k]}
</p:column>
<p:column headerText="5">
#{config.configTable[4][k]}
</p:column>
<p:column headerText="6">
#{config.configTable[5][k]}
</p:column>
<p:column headerText="7">
#{config.configTable[6][k]}
</p:column>
<p:column headerText="8">
#{config.configTable[7][k]}
</p:column>
<p:column headerText="9">
#{config.configTable[8][k]}
</p:column>
<p:column headerText="10">
<p:commandButton value="Konfiguracja" actionListener="#{configBean.getIndex()}"/>
</p:column>
</p:dataTable>
I've tried putting Lists, strings and ints to "selection" to get some data from it, with no luck.
configTable is List<List<String>>=ArrayList<>();