p:dataTable problem in SNAPSHOT

UI Components for JSF
Alan
Posts: 102
Joined: 25 Oct 2010, 04:45

29 Oct 2010, 18:45

On advice in another thread I upgraded from 2.2.M1 to 2.2RC1-SNAPSHOT.

When doing so, the update attribute in p:dataTable stops working. I use it to display detail of a record outside the table on the same page and it works very nice on 2.2.M1.

Unrelated, the xmlns:p="http://primefaces.prime.com.tr/ui" is no longer seen by the Netbeans editor. The JSF implementation does see it so the tags all get compiled but I guess there is something wrong in the TLD for the SNAPSHOT.

Regards,
Netbeans 7.1, GlassFish 3.1.1, MacOS X 10.6.8, Safari, Firefox

callahan
Posts: 768
Joined: 27 May 2010, 22:52

29 Oct 2010, 19:36

I suppose that idiot callahan told you to upgrade! Can you post your code? It's difficult to say whats going wrong with updates without seeing the source.

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

29 Oct 2010, 20:09

There is no tld in 2.2.RC1 and no jsp tag classes. My NetBeans 6.9 scans the PrimeFaces facelet taglib just fine to do code completion.

update attribute is now known as onRowSelectUpdate, although I remember doing this change backward compatible so update should still be supported if I'm not mistaken.

Code from DataTableRenderer line 636;

Code: Select all

//update is deprecated and used for backward compatibility
String onRowSelectUpdate = table.getOnRowSelectUpdate() != null ? table.getOnRowSelectUpdate() : table.getUpdate();

Alan
Posts: 102
Joined: 25 Oct 2010, 04:45

30 Oct 2010, 03:28

If it helps here is the XHTML. This works in M1, not in SNAPSHOT. And SNAPSHOT didn't work either changing update to onRowSelectUpdate. Also, when clicking on rows the background toggles for the row but does not enforce selectionMode="single".

Looking at the browser's console, I did not get any script errors.

Code: Select all

                
                 <h:form id="llForm">
                    <p:dataTable
                        value="#{listLocations.lazyDataModel}"
                         lazy="true"
                         paginator="true"
                         selection="#{listLocations.selectedLocation}"
                         selectionMode="single"
                         update="llSelected"
                         rows="16"
                         var="loc"
                         dynamic="true"
                         emptyMessage="No Locations In Data Base"
                         loadingMessage="Loading ...."
                         >
                        <p:column sortBy="#{id}">
                            <f:facet name="header">
                                <h:outputText value="ID"/>
                            </f:facet>
                            <h:outputText value="#{loc.id}" />
                        </p:column>

                        <p:column sortBy="#{name}" filterBy="#{name}">
                            <f:facet name="header">
                                <h:outputText value="Name"/>
                            </f:facet>
                            <h:outputText value="#{loc.name}" />
                        </p:column>

                     <!-- removed some columns for brevity -->
                    </p:dataTable>

                    <h:panelGroup id="llSelected">
                        Selected Location: #{listLocations.selectedLocation.fullName}
                    </h:panelGroup>
                </h:form>
Netbeans 7.1, GlassFish 3.1.1, MacOS X 10.6.8, Safari, Firefox

Alan
Posts: 102
Joined: 25 Oct 2010, 04:45

30 Oct 2010, 04:28

There is no tld in 2.2.RC1 and no jsp tag classes. My NetBeans 6.9 scans the PrimeFaces facelet taglib just fine to do code completion.
I was afraid you would say that. Apparently this is some sort of on-going problem with netbeans. The issue has been seen as far back as 6.5 and the issue keeps getting closed then opened again.

http://netbeans.org/bugzilla/show_bug.cgi?id=172520

If I figure out what is going on I will post it. Annoying.
Netbeans 7.1, GlassFish 3.1.1, MacOS X 10.6.8, Safari, Firefox

callahan
Posts: 768
Joined: 27 May 2010, 22:52

30 Oct 2010, 12:01

I can't see anything that would explain why the update isn't working. Does clearing the browsers cache help?

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

30 Oct 2010, 12:58

Also compare with;

http://www.primefaces.org/showcase/ui/d ... nstant.jsf

Try with non-lazy as well to see if it helps;

Alan
Posts: 102
Joined: 25 Oct 2010, 04:45

31 Oct 2010, 18:44

Does clearing the browsers cache help?
Try with non-lazy as well to see if it helps
OK I did try all this and a few things more and no joy. But this is freaky: I downloaded a copy of the latest Firefox with the intent of debugging the browser side scripts with Firebug but didn't get the chance. Everything works in the Firefox browser! Argh!

I have three browser windows open side by side on my 27 inch iMac: Safari, Chrome, and Firefox all pointing to the same server on localhost. The same URL. The Firefox browser processes the row selections exactly as expected, the others do not. Heisenberg effect? No, I turn off Firebug and it still works.

Any suggestions?
Netbeans 7.1, GlassFish 3.1.1, MacOS X 10.6.8, Safari, Firefox

callahan
Posts: 768
Joined: 27 May 2010, 22:52

31 Oct 2010, 19:14

Is it because <f:view contentType="text/html"> is missing on the page? See FAQ 6 on page 410 of the User's Guide.

Alan
Posts: 102
Joined: 25 Oct 2010, 04:45

31 Oct 2010, 20:55

Is it because <f:view contentType="text/html"> is missing on the page
Well flying frick on a fracking cracker. That seems to fix it.

I think this note needs to be added to the User's back in Chapter 2. Notice the "Hello World" starter doesn't have <f:view> in it.

It turns out that I have run into this before, with gmaps4jsf library which has the same issue. That should have made me alert to this. What happens is that the browsers render either an HTML DOM or a XML DOM depending on the content of the page. It looks like some of primefaces but not all of it depends on the objects that show up by default in the HTML DOM but not XML DOM. I guess Firefox implements a workaround for this.

Thanks everyone for all the attention.
Netbeans 7.1, GlassFish 3.1.1, MacOS X 10.6.8, Safari, Firefox

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 5 guests