Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to get the dataTable row id ?  RSS feed

 
Marius Cloete
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Kurt Boets
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Marius Cloete
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Kurt Boets
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's right.
Hope it works !
 
Marius Cloete
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You might take a look at this thread where something very similar was discussed.
 
Kurt Boets
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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)






 
Varun Khanna
Ranch Hand
Posts: 1400
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This thread does require some edit work for better readability.
 
Marcos Maia
Ranch Hand
Posts: 977
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Varun Khanna:
This thread does require some edit work for better readability.


I agree.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!