File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

DataTable row not being updated in PrimeFaces

 
Guy deLyonesse
Ranch Hand
Posts: 200
Eclipse IDE Java Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 17620
39
Android Eclipse IDE Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Guy deLyonesse
Ranch Hand
Posts: 200
Eclipse IDE Java Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Tim, Thanks for the reply.

Isn't that covered in the update="formAnalyze:availableStudy" attribute in the commandButton?
 
Tim Holloway
Saloon Keeper
Pie
Posts: 17620
39
Android Eclipse IDE Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 200
Eclipse IDE Java Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 17620
39
Android Eclipse IDE Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 200
Eclipse IDE Java Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic