p:datatable inside a p:dialog

UI Components for JSF
Post Reply
daniel.bacher
Posts: 1
Joined: 06 Dec 2010, 19:20

09 Dec 2010, 10:17

Hi there,

We use a p:datatable inside a p:dialog.
We encountered two major problems when selecting table rows we could fix by patching the JS for the datatable only.
a) Event bubbling for the JQuery "live" events:
The events for the selection seem not to be stopped in the selection event handler (the rows are not selected due to the fact the handler is called multiple times in this case).

We added:

Code: Select all

.live(selectEvent, function(event) {	
            	// added return
            	return _self.onRowClick(event, this);             
            });

onRowClick = function(event, rowElement) {
    //Check if rowclick triggered this event not an element in row content
    if(jQuery(event.target).is('td,span')) {
...
        // add false for selection events
        return false;
       
    }
    // continue otherwise
    return true;
}
b) "Stacked" live-event-handlers in case the dialog is rerenderd using ajax.
Our dialog is rerendered using ajax. This caused the addition of a new live-event handler for each call.

We solved this issue by adding:

Code: Select all

$(this.jqId + ' .ui-datatable-data tr').die();
in the setupSelectionEvents-method.

Are there other solutions to solve this issues than patching the JS?

TIA, Daniel

PrimeFaces 2.2R C2
Mojarra 2.0.2
GlassFish 3.0.1

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

09 Dec 2010, 16:33

Hi Daniel

Have you created an issue ticket regarding this?

We can test and apply your patch so it can make it to 2.2 final.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 97 guests