Strange problems with inconsistent ajax behavior

UI Components for JSF
absmiths
Posts: 15
Joined: 13 Apr 2010, 16:31

13 Apr 2010, 16:41

I have been having some strange problems involving ajax and it is driving me nuts. Let me state right away that I am sure the problem is the way I am building my app. I am using Primefaces 2.0.0 on Glassfisfh v3. I have a p:dataList in a form with a p:dialog. The dialog pops up a form to create a new record which will add an entry into the dataList using ajax, and the dataList has a delete button on each row which will delete the row and refresh the dataList also using ajax. Here is basically how I have it configured:

Code: Select all

<h:form id="listForm">
  <p:dialog>
   <p:commandButton async="true" action="#{bean.persist}" update="listForm" />
  </p:dialog>

  <p:dataList id="listTable">
   <p:column>
     <p:commandButton ajax="true" process="listForm" action="#{entity.delete}" />
   </p:column>
  </p:dataList>
</h:form>
I have simplified the delete button - it is actually in a composite component. If I take ajax out, both the new and delete functions work correctly. If I enable ajax, however, both invoke ajax actions but the server side actions never get called. Is there something obviously wrong with this?

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

13 Apr 2010, 17:50

We are looking into this issue at the moment;

http://code.google.com/p/primefaces/iss ... ail?id=698

This might be related to your problem, I'll update this post once we fix it and make sure your code runs fine locally.

absmiths
Posts: 15
Joined: 13 Apr 2010, 16:31

13 Apr 2010, 18:17

I'll keep my eyes on this thread and will test anything you want me too.

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

13 Apr 2010, 18:43

Strange, I've tested a simple page with commandLink in a column and it worked. Can you take out process config and try again.

absmiths
Posts: 15
Joined: 13 Apr 2010, 16:31

13 Apr 2010, 20:07

I'll try that and then let you know.

absmiths
Posts: 15
Joined: 13 Apr 2010, 16:31

13 Apr 2010, 20:22

I changed the submit on my 'new' form to be like this, and the new action is being called but the view is not refreshed:

Code: Select all

				<prime:commandButton id="createButton" value="Create" ajax="true" async="false" oncomplete="dlg.hide();" action="#{actorBean.newBean.persist}" />

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

13 Apr 2010, 20:41

You need to use update attribute to configure what to update on your page.

Simplest example;

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

absmiths
Posts: 15
Joined: 13 Apr 2010, 16:31

13 Apr 2010, 21:32

I had that on there before but I just took it off as a test. I will try to add it back again - maybe I am losing my mind.

I just created a very basic example and it works correctly.

Update: I added update="listForm" just like my simple example and neither work in my real-world app. Do you have any pointers on how to debug it? I think one mistake I was making was using the process attribute instead of update. After fixing that, my actions are getting called (they weren't before for some reason), and the ajax status component animates then completes, but the screen is not refreshed. If I reload the page I can see the updates.

Where should I look for info? I don't see anything in the server logs.

absmiths
Posts: 15
Joined: 13 Apr 2010, 16:31

13 Apr 2010, 22:33

cagatay.civici wrote:You need to use update attribute to configure what to update on your page.

Simplest example;

http://www.primefaces.org:8080/prime-sh ... Update.jsf
I can't see the showcases at work because the ports are blocked. I downloaded the war and deployed to glassfish and I can't get into it, so I will have to check this out later.

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

18 Apr 2010, 22:01

If you provide your full page code, we can help more.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 15 guests