incubator-adffaces-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Günther, Thorsten <Thorsten.Guent...@medocino.de>
Subject First click on commands fails if PPR occured beforehand, elaborated
Date Fri, 25 Aug 2006 08:31:30 GMT
Hi list!

I have done a bit more research on a problem I described a while ago (old mail attached).
Problem is: When a PPR occurred on one of my pages a first click on command-buttons only results
in a full page reload. The desired command is not executed. Any subsequent click on any command-button
on the page succeeds.
I think I found how this happens but I can not explain why. That's for sure because of my
lacking knowledge of JSF and Trinidad internals. So I would be very thankful if you could
take a look on this, since for my projects this behaviour (called the "the double-click feature"
here :-) is a real show-stopper. Please excuse any imprecise wording. I'm only at the beginning
of understanding how all this works.

The following is my assumption on what happens:
When a PPR occurs the ID's of the command-buttons are changed on the server-side (in the representation
of the page-structure and state which resides on the server). Since a PPR is executed only
the id's in the HTML regenerated by the PRR are changed on the client-side. When I click on
a command-button that has not been regenerated the id that is send to the server in the "source"
request-parameter no longer exists. The server-side does not know what to do on this command
and reloads the whole page without executing any application code. This full page reload fixes
the id's in the HTML and any subsequent click on any command succeeds in executing application-code.
Also further PPR's seem not to change the id's any more.


What follows below is some evidence I collected for my assumption.

Any help or hint where to look / trace in what code to gain further understanding of what
happens here is highly appreciated.

Regards,
Thorsten




Directly after first page load:
-----snip------
     <td class="x48"><!-- Start: org.apache.myfaces.trinidad.Panel["_id27"] --><table
cellpadding="0" cellspacing="0" border="0"><tr>
                                    <td><!-- Start: org.apache.myfaces.trinidad.Command["_id29"]
-->
                                      <button class="xi" onclick="submitForm('_id4',1,{source:'_id5:_id29'});return
false;" type="button">Speichern</button>

                                    </td>
                                  </tr></table></td>
-----snip------



After changing on a different tab of a tr:panelTabbed (a PPR) which is in another part of
the same page (eg. the button is outside the tr:panelTabbed). The HTML of the button has not
changed.
-----snip------
     <td class="x48"><!-- Start: org.apache.myfaces.trinidad.Panel["_id27"] --><table
cellpadding="0" cellspacing="0" border="0"><tr>
                                    <td><!-- Start: org.apache.myfaces.trinidad.Command["_id29"]
-->
                                      <button class="xi" onclick="submitForm('_id4',1,{source:'_id5:_id29'});return
false;" type="button">Speichern</button>

                                    </td>
                                  </tr></table></td>
-----snip------



After first click on "Speichern" the page fully reloads, the desired action has not been triggered
and the id of the command button has changed.:
-----snip------
                              <td class="x48"><!-- Start: org.apache.myfaces.trinidad.Panel["_id11"]
--><table cellpadding="0" cellspacing="0" border="0"><tr>
                                    <td><!-- Start: org.apache.myfaces.trinidad.Command["_id13"]
-->
                                      <button class="xi" onclick="submitForm('_id4',1,{source:'_id5:_id13'});return
false;" type="button">Speichern</button>

                                    </td>
                                  </tr></table></td>
-----snip------





-----Ursprüngliche Nachricht-----
Von: Günther, Thorsten [mailto:Thorsten.Guenther@medocino.de] 
Gesendet: Sonntag, 13. August 2006 23:16
An: adffaces-user@incubator.apache.org
Betreff: First click on commands fails if PPR occured beforehand

Hi!

 

When I use PPR on a page, for example via autoSubmit in some element, a click subsequent to
the PPR on a command-button reloads the whole page but does not issue the intended command.
A second click (on the same or another command-button) issues the command as expected.

 

I use a current trunk build of Trinidad and facelets.

 

Has anyone seen this behaviour before and can give me hint how to solve this?

 

Regards,

Thorsten

 



Mime
View raw message