Forums Register Login

How to get the dataTable row id ?

+Pie Number of slices to send: Send
Hi all,

When you look at the id of the row in the page source of your browser window
(id="form1:table1:1:cell1") I am interested in the single digit "1" that
represents the current row.That row value is also the index number of the
array of elements that was used in the data table. How will I be able to get
that value back so I can use it in my code?

Any ideas will be much appreciated, thx.
[ June 09, 2005: Message edited by: Gregg Bolinger ]
+Pie Number of slices to send: Send
Hi Marius,

Perhaps you can use a binding. You can use a UIData element to bind and so retrieve the index of your row.
Hope it helps.
+Pie Number of slices to send: Send
Thx Kurt,

Do you mean I need to add an int[] rowNumber to the bean thats holds the identifier and then access it this way #{arrayVar.rowNumber}?

I'll try that.
+Pie Number of slices to send: Send
That's right.
Hope it works !
+Pie Number of slices to send: Send
Hi Kurt,

Thx that did work but it feels like I "hacked" the system, I am sure there must be/should be a better/standard way of doing this.

But till then thank you Kurt this will do it.

This is wat I added to java page code...


the rest is standard

Thanks and cheerz
+Pie Number of slices to send: Send
You might take a look at this thread where something very similar was discussed.
+Pie Number of slices to send: Send
Hi Marius,

The following code will get the index out of a DataList (and is used to change my look and feel). Perhaps it can give you some extra info.

jsf page with the binding + rowindex
java bean (rowindex is used to calculate month)






+Pie Number of slices to send: Send
This thread does require some edit work for better readability.
+Pie Number of slices to send: Send
 

Originally posted by Varun Khanna:
This thread does require some edit work for better readability.



I agree.
Sasparilla and fresh horses for all my men! You will see to it, won't you tiny ad?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 16530 times.
Similar Threads
MySQL auto increment
how to set checked to checkbox and radio button
problem with inser into query
help with methods in jsp
Radio Button Group
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 02:24:07.