File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes DataTable row not being updated in PrimeFaces Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "DataTable row not being updated in PrimeFaces" Watch "DataTable row not being updated in PrimeFaces" New topic
Author

DataTable row not being updated in PrimeFaces

Guy deLyonesse
Ranch Hand

Joined: Apr 12, 2011
Posts: 200

Hey all,

This is actually a feature that had been working at one time and has now ceased. The change? It's now a portlet in Liferay.

What is supposed to happen is a DataTable, which starts out empty, gets values added to it when the user makes some selections and clicks a commandButton.



edit: Code from the backing bean...



Using debug statements I've verified that the ArrayList that feeds the DataTable is being updated, but the control on the page isn't. I gather the update isn't able to find the component anymore now that it's in a Liferay context... but looking at the component path in the page source gives me the naming containers I'm already defining in the update.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16305
    
  21

I haven't done anything with PrimeFaces in a long time, but I do have a suspicion.

When you use AJAX to manage a SUBMIT, you normally have to indicate what parts of the View (if any) need to be updated to reflect the results of that submission. I didn't notice any re-rendering element IDs in your View template.


Customer surveys are for companies who didn't pay proper attention to begin with.
Guy deLyonesse
Ranch Hand

Joined: Apr 12, 2011
Posts: 200

Hey Tim, Thanks for the reply.

Isn't that covered in the update="formAnalyze:availableStudy" attribute in the commandButton?
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16305
    
  21

Well, I', A) blind and B) used to other notations. But presumably so.

I'd recommend trying for just "availableStudy" as the re-render target. It's already relative to the same parent as the submit button.
Guy deLyonesse
Ranch Hand

Joined: Apr 12, 2011
Posts: 200

Is it? (Learning experience for me) the commandButton is inside the analyzeTreeHolder panelGroup, which makes it under a separate parent from the DataTable, or am I misunderstanding? (I had originally tried the update pointing directly at availableStudy.)

I'm thinking it must have something to do with being moved into a portlet environment, but it's not clear to me how.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16305
    
  21

You're thinking literal parent. But in any event, I'm not sure a panelGroup is actually a Naming Container, and only Naming Containers and targets are actually important for identification.

Suffice it to say that usually I don't qualify my render IDs. The stock location algorithms are pretty good at finding stuff based on simple names as long as there aren't any ambiguities.

(edited)
Today, alas, doesn't seem to be my day for accurate typing.
Guy deLyonesse
Ranch Hand

Joined: Apr 12, 2011
Posts: 200

Well, I discovered the problem.

It seems a progressBar that had been added to the page was interfering with the way things were working. I learned this by converting a similar view into a portlet and testing it, and it worked perfectly. The only significant difference between the two page views was that progressBar, which was installed as a facet of the DataTable.

So, I'll be looking to determine why the progressBar was breaking things, but for now, the mystery is solved.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: DataTable row not being updated in PrimeFaces