Get column_id on cellEdit event (DataTable)

UI Components for JSF
Post Reply
cmastrantono
Posts: 11
Joined: 23 Apr 2012, 17:58

04 Sep 2017, 19:50

Hi,

I'm wondering how to get column id from a cellEdit event.

I need row_Id and column_Id. Row_Id is easy, just event.getRowIndex(); ... but how about the column_id?

I'm doing an awful string parsing from the event.getColumn().getColumnKey()... but it should exist a straightforward solution.

ps: I'm using editMode="cell" and dynamic columns with a Column Model

Any thoughts?
Thanks!

kukeltje
Expert Member
Posts: 9605
Joined: 17 Jun 2010, 13:34
Location: Netherlands

04 Sep 2017, 23:18

why should there exist a straightforward solution? You seem to be the first one asking this over all these years, so to me it is not something that should exist as a straightforward solution. Why do you (think you) need the column_id? (I'm not saying you do not need it, just curious what the usecase is and maybe there is a different solution)

cmastrantono
Posts: 11
Joined: 23 Apr 2012, 17:58

19 Sep 2017, 23:00

kukeltje wrote:
04 Sep 2017, 23:18
why should there exist a straightforward solution? You seem to be the first one asking this over all these years, so to me it is not something that should exist as a straightforward solution. Why do you (think you) need the column_id? (I'm not saying you do not need it, just curious what the usecase is and maybe there is a different solution)
Sorry about that, I didn't mean to sound as a bad guy ;)

My use case is not common (need to publish which column has changed so another column whose value depends on it recalculates itself), and that's why maybe nobody asked about the column id in this years.

Nevermind, I'll keep doing my parsing, just thought this was basic (my bad, again) =)

Cheers
Cristian.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 52 guests