How to capture row selection javascript event from dataTable

UI Components for JSF
Post Reply
krantas
Posts: 2
Joined: 12 Jan 2010, 12:06

13 Jan 2010, 08:33

Hello:

Please forgive if I have any english error. I'm a user from Taiwan.

I'd like to capture dataTable's row selection event (onclick?) and use it to do something. Ajax instant selection seems don't work (update won't fire and onselectComplete only fire the first time after the page is loaded). I can get the JS variable, but how do I define (or bind, subscribe) the row event? I have tried the stuff in YUI demos but they do not work as well.

I'm using JSF 2 + Primefaces 2, and using Facelets composite pages. Thanks for any answer.

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

13 Jan 2010, 14:56

Does this example work for you?

http://www.primefaces.org:8080/prime-sh ... onAjax.jsf

Are you trying to do the same?

Which PrimeFaces 2 are you using? Also can you post the related code so I can take a quick look. Thanks.

krantas
Posts: 2
Joined: 12 Jan 2010, 12:06

14 Jan 2010, 03:48

cagatay.civici wrote:Does this example work for you?

http://www.primefaces.org:8080/prime-sh ... onAjax.jsf

Are you trying to do the same?

Which PrimeFaces 2 are you using? Also can you post the related code so I can take a quick look. Thanks.
I have tried the example, but have no success. I'm using primefaces-2.0.0.RC. And I'm afraid I cannot post the code here...it has too many business secret in it :? (and very very large)

Basically, I have a p:dataTable and a p:tabView, each placed in a h:panelGroup. When I click a item in the datatable, it should
1. run ajax and get the selected object into bean
2. update panel control variables and data related to the selected object in the bean
3. update the page, hide the panelGroup with datatable and display the one with tabview (which is previously hidden)

The "update" seemed work with only one ID. I tried form ID or place a form-wide panelGroup but they don't work.

Then I tried using a command button with ajax, "click" it via onselectComplete. It would run for only the first time (maybe the panel switching cause the problem, I don't know.)

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

14 Jan 2010, 12:46

Which JSF version are you using?

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 63 guests