Combination View Flat View Tree View
Threads [ Previous | Next ]
Fabio Margarido
Problem with selectable dataTable items in Primefaces
September 27, 2012 1:21 PM
Answer

Fabio Margarido

Rank: New Member

Posts: 6

Join Date: September 27, 2012

Recent Posts

Hi there,

I'm developing an application using Liferay 6.1.0 GA1, Liferay Faces Bridge 3.1.0 GA1 and Primefaces 3.4.

I have a portlet with a dataTabel backed by a ViewScoped bean. The dataTable is configured with selectionMode="single" and the items list implements SelectableDataModel. My portlet is configured with ajaxable=false;

If I drag one instance of the portlet to a page, select an item from the table and submit the form, everything works as expected. However, If I add two instances of the portlet, when I select an item and submit, I'm observing erratic behavior. The first time, I get a null reference in the object set as the selection attribute of the data Table. Afterwards, sometimes the object is set to the wrong item of the table.

Can anyone provide some guidance, please? If you need more information I'll be happy to provide it.

Thank you very much.

Fabio
Neil Griffin
RE: Problem with selectable dataTable items in Primefaces
September 27, 2012 1:26 PM
Answer

Neil Griffin

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1862

Join Date: July 26, 2005

Recent Posts

Hi Fabio,

I think that you are now the second person to run into a ViewScoped use-case that we haven't addressed yet in Liferay Faces Bridge. When you get a chance, please read this thread and let me know if it sounds like the same problem you are encountering.

Thanks,

Neil
Fabio Margarido
RE: Problem with selectable dataTable items in Primefaces
September 27, 2012 4:47 PM
Answer

Fabio Margarido

Rank: New Member

Posts: 6

Join Date: September 27, 2012

Recent Posts

Hi Neil, thanks for the prompt reply.

I've read the thread you've mentioned, but I don't think I'm having the same problem Juan has. In my case, I'm not trying to navigate, it's simply calling an action. And when I said form submit in my original post, I meant AJAX requests. Sorry for not making that clearer.

Just to be sure, I've changed my bean to SessionScoped, but it didn't seem to make any difference.

I've also tried to enable instant row selection in the dataTable (using the p:ajax tag, as in the demo in Primefaces' website), but that seemed to make it worse. The first time I select a row, the listener fires, but with a null object. From then on, I can select as many rows as I want and the listener never fires again...

Thanks.
Neil Griffin
RE: Problem with selectable dataTable items in Primefaces
September 28, 2012 9:01 AM
Answer

Neil Griffin

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1862

Join Date: July 26, 2005

Recent Posts

Hi Fabio,

When you get a chance, please try the same test, except with two different portlets (both defined in the same WAR project).

That might help me determine what the problem might be.

Thanks,

Neil