getting a full refresh at submission

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

getting a full refresh at submission

dr.cw.ray
How can I get a full refresh of my xforms web page at submission?
When I change the instance, it is reflected in the page, as it should
be, however, at submission there are certain attribute updates that
take place on the server side, so I need to be 100 percent sure that I
get a full refresh that will reflect those server-side updates.  I
currently have my submission's actions set to a php file that accepts
the data, updates it, and then reloads the page, but that doesn't seem
to get a true refresh of the page (seems like maybe Firefox is
considering the page a "recently visited" page and so it assumes that,
without a manual refresh, the underlying data is as it was on the last
visit).

At any rate, if my explanation is not good, I just want my user to hit
the "submit" and then a message  pops up (courtesy of xforms-submit-
done) that says, data submitted. When they close that box and are
looking at the page again, I need to be sure that they have a 100%
reloaded page (updated instance from the server).
_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
Reply | Threaded
Open this post in threaded view
|

RE: getting a full refresh at submission

Philip Fennell-3
In this case the response to your request would ideally be the server-side updated XML. The xf:submission options should be set to replace="instance" and then the form should reflect those changes.

I'm not aware of you needing to do anything else.

> I currently have my submission's actions set
> to a php file that accepts the data, updates
> it, and then reloads the page

You do not say why you are having the page reloaded. Is there a reason for this?


Regards

Philip Fennell
Consultant

Mark Logic Corporation
www.marklogic.com

E-mail: [hidden email]
Mobile: +44 (0)7824 830 866






 -----Original Message-----
From: dev-tech-xforms-bounces+philip.fennell=[hidden email] [mailto:dev-tech-xforms-bounces+philip.fennell=[hidden email]] On Behalf Of dr.cw.ray
Sent: 04 January 2010 01:24
To: [hidden email]
Subject: getting a full refresh at submission

How can I get a full refresh of my xforms web page at submission?
When I change the instance, it is reflected in the page, as it should
be, however, at submission there are certain attribute updates that
take place on the server side, so I need to be 100 percent sure that I
get a full refresh that will reflect those server-side updates.  I
currently have my submission's actions set to a php file that accepts
the data, updates it, and then reloads the page, but that doesn't seem
to get a true refresh of the page (seems like maybe Firefox is
considering the page a "recently visited" page and so it assumes that,
without a manual refresh, the underlying data is as it was on the last
visit).

At any rate, if my explanation is not good, I just want my user to hit
the "submit" and then a message  pops up (courtesy of xforms-submit-
done) that says, data submitted. When they close that box and are
looking at the page again, I need to be sure that they have a 100%
reloaded page (updated instance from the server).
_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
Reply | Threaded
Open this post in threaded view
|

Re: getting a full refresh at submission

dr.cw.ray
In reply to this post by dr.cw.ray
On Jan 5, 1:13 am, Philip Fennell <[hidden email]>
wrote:

> In this case the response to your request would ideally be the server-side updated XML. The xf:submission options should be set to replace="instance" and then the form should reflect those changes.
>
> I'm not aware of you needing to do anything else.
>
> > I currently have my submission's actions set
> > to a php file that accepts the data, updates
> > it, and then reloads the page
>
> You do not say why you are having the page reloaded. Is there a reason for this?
>
> Regards
>
> Philip Fennell
> Consultant
>
> Mark Logic Corporationwww.marklogic.com
>
> E-mail: [hidden email]
> Mobile: +44 (0)7824 830 866
>
>  -----Original Message-----
> From: dev-tech-xforms-bounces+philip.fennell=[hidden email] [mailto:dev-tech-xforms-bounces+philip.fennell=[hidden email]] On Behalf Of dr.cw.ray
> Sent: 04 January 2010 01:24
> To: [hidden email]
> Subject: getting a full refresh at submission
>
> How can I get a full refresh of my xforms web page at submission?
> When I change the instance, it is reflected in the page, as it should
> be, however, at submission there are certain attribute updates that
> take place on the server side, so I need to be 100 percent sure that I
> get a full refresh that will reflect those server-side updates.  I
> currently have my submission's actions set to a php file that accepts
> the data, updates it, and then reloads the page, but that doesn't seem
> to get a true refresh of the page (seems like maybe Firefox is
> considering the page a "recently visited" page and so it assumes that,
> without a manual refresh, the underlying data is as it was on the last
> visit).
>
> At any rate, if my explanation is not good, I just want my user to hit
> the "submit" and then a message  pops up (courtesy of xforms-submit-
> done) that says, data submitted. When they close that box and are
> looking at the page again, I need to be sure that they have a 100%
> reloaded page (updated instance from the server).
> _______________________________________________
> dev-tech-xforms mailing list
> [hidden email]://lists.mozilla.org/listinfo/dev-tech-xforms

Thanks Phillip.
I've tried setting my replace to different values without effect and
that is why I was reloading the page via php.
Basically the psuedo code is like this:
   <? php

    ...get the submitted data;
   ... lock xml file; open xml file;  update xml data and attributes;
save/unlock xml file.

   $loadMainPage="
   <xml ...
   <html...
   ...
   <xf:model>
      <xf:action ev:event="xforms-ready">
        <xf:load resource="theMainPage.xhtml" show="replace"/>
      </xf:action>
   </xf:model>
   ...
   </html>"

   echo $loadMainPage;
?>

I can't seem to pinpoint the problem, the replace values don't affect
anything. When I use "none" it maintains the correct display (as-is at
submission), but in this case, the underlying attributes are not
updated to reflect their state after server-side manipulation.  When I
use "instance" it doesn't work because I actually have several
instances getting  updated that reflect the state of my page, Finally,
when I use "all"  I get a new page displayed but it goes back to the
state of the model before submission (maybe it grabs the xml file
(model) before the server has time to update it??).

The php reload script also loads the page based on the state of the
xml document (model) prior to submission. All I know is that if I
click on the FireFox reload button after submission and after the page
is displaying again, all is well and all updates are reflected in the
data, but I have to do it manually. Was just wondering if there was
some other way to get a true refresh when the page loads after
submission without doing it manually every time.

I think this info probably doesn't help much, so if nothing flies off
the top of your head, don't worry about it too much, I can get back to
it at a later date.

_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
Reply | Threaded
Open this post in threaded view
|

RE: getting a full refresh at submission

Philip Fennell-3
I must admit I'm somewhat baffled, unless that is there is an issue with multiple xf:instance elements within a single xf:model. Unless you explicitly tell the xf:submission element in question which instance you are submitting and to which instance to return the response to, then you may get the default behaviour which selects the first xf:instance in document order of the first xf:model. In other words, the response may not be going where you think it's going.

I hope that helps.



Regards

Philip Fennell
Consultant

Mark Logic Corporation
www.marklogic.com

E-mail: [hidden email]
Mobile: +44 (0)7824 830 866



-----Original Message-----
From: dev-tech-xforms-bounces+philip.fennell=[hidden email] [mailto:dev-tech-xforms-bounces+philip.fennell=[hidden email]] On Behalf Of dr.cw.ray
Sent: 05 January 2010 04:11
To: [hidden email]
Subject: Re: getting a full refresh at submission

On Jan 5, 1:13 am, Philip Fennell <[hidden email]>
wrote:

> In this case the response to your request would ideally be the server-side updated XML. The xf:submission options should be set to replace="instance" and then the form should reflect those changes.
>
> I'm not aware of you needing to do anything else.
>
> > I currently have my submission's actions set
> > to a php file that accepts the data, updates
> > it, and then reloads the page
>
> You do not say why you are having the page reloaded. Is there a reason for this?
>
> Regards
>
> Philip Fennell
> Consultant
>
> Mark Logic Corporationwww.marklogic.com
>
> E-mail: [hidden email]
> Mobile: +44 (0)7824 830 866
>
>  -----Original Message-----
> From: dev-tech-xforms-bounces+philip.fennell=[hidden email] [mailto:dev-tech-xforms-bounces+philip.fennell=[hidden email]] On Behalf Of dr.cw.ray
> Sent: 04 January 2010 01:24
> To: [hidden email]
> Subject: getting a full refresh at submission
>
> How can I get a full refresh of my xforms web page at submission?
> When I change the instance, it is reflected in the page, as it should
> be, however, at submission there are certain attribute updates that
> take place on the server side, so I need to be 100 percent sure that I
> get a full refresh that will reflect those server-side updates.  I
> currently have my submission's actions set to a php file that accepts
> the data, updates it, and then reloads the page, but that doesn't seem
> to get a true refresh of the page (seems like maybe Firefox is
> considering the page a "recently visited" page and so it assumes that,
> without a manual refresh, the underlying data is as it was on the last
> visit).
>
> At any rate, if my explanation is not good, I just want my user to hit
> the "submit" and then a message  pops up (courtesy of xforms-submit-
> done) that says, data submitted. When they close that box and are
> looking at the page again, I need to be sure that they have a 100%
> reloaded page (updated instance from the server).
> _______________________________________________
> dev-tech-xforms mailing list
> [hidden email]://lists.mozilla.org/listinfo/dev-tech-xforms

Thanks Phillip.
I've tried setting my replace to different values without effect and
that is why I was reloading the page via php.
Basically the psuedo code is like this:
   <? php

    ...get the submitted data;
   ... lock xml file; open xml file;  update xml data and attributes;
save/unlock xml file.

   $loadMainPage="
   <xml ...
   <html...
   ...
   <xf:model>
      <xf:action ev:event="xforms-ready">
        <xf:load resource="theMainPage.xhtml" show="replace"/>
      </xf:action>
   </xf:model>
   ...
   </html>"

   echo $loadMainPage;
?>

I can't seem to pinpoint the problem, the replace values don't affect
anything. When I use "none" it maintains the correct display (as-is at
submission), but in this case, the underlying attributes are not
updated to reflect their state after server-side manipulation.  When I
use "instance" it doesn't work because I actually have several
instances getting  updated that reflect the state of my page, Finally,
when I use "all"  I get a new page displayed but it goes back to the
state of the model before submission (maybe it grabs the xml file
(model) before the server has time to update it??).

The php reload script also loads the page based on the state of the
xml document (model) prior to submission. All I know is that if I
click on the FireFox reload button after submission and after the page
is displaying again, all is well and all updates are reflected in the
data, but I have to do it manually. Was just wondering if there was
some other way to get a true refresh when the page loads after
submission without doing it manually every time.

I think this info probably doesn't help much, so if nothing flies off
the top of your head, don't worry about it too much, I can get back to
it at a later date.

_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
Reply | Threaded
Open this post in threaded view
|

Re: getting a full refresh at submission

Dion Sole
In reply to this post by dr.cw.ray
On Jan 5, 5:11 pm, "dr.cw.ray" <[hidden email]> wrote:

> On Jan 5, 1:13 am, Philip Fennell <[hidden email]>
> wrote:
>
>    $loadMainPage="
>    <xml ...
>    <html...
>    ...
>    <xf:model>
>       <xf:action ev:event="xforms-ready">
>         <xf:load resource="theMainPage.xhtml" show="replace"/>
>       </xf:action>
>    </xf:model>
>    ...
>    </html>"
>
>    echo $loadMainPage;
> ?>

Might also be worth noting that xforms-ready only fires on the initial
page load, and not when a submission has completed. So if you're
expecting this to load the resource upon submission finishing, it
won't work.

Not sure if I'm understanding what you're intending with that bit of
code though.
_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
Reply | Threaded
Open this post in threaded view
|

Re: getting a full refresh at submission

dr.cw.ray
On Jan 5, 5:58 pm, Dion <[hidden email]> wrote:

> On Jan 5, 5:11 pm, "dr.cw.ray" <[hidden email]> wrote:
>
>
>
> > On Jan 5, 1:13 am, Philip Fennell <[hidden email]>
> > wrote:
>
> >    $loadMainPage="
> >    <xml ...
> >    <html...
> >    ...
> >    <xf:model>
> >       <xf:action ev:event="xforms-ready">
> >         <xf:load resource="theMainPage.xhtml" show="replace"/>
> >       </xf:action>
> >    </xf:model>
> >    ...
> >    </html>"
>
> >    echo $loadMainPage;
> > ?>
>
> Might also be worth noting that xforms-ready only fires on the initial
> page load, and not when a submission has completed. So if you're
> expecting this to load the resource upon submission finishing, it
> won't work.
>
> Not sure if I'm understanding what you're intending with that bit of
> code though.

Thanks all for the advice,
That gives me something to work on. I'm still not real sure why using
php to generate an xhtml/xforms that in turn loads the original
submitting "mainPage" doesn't give me a full refresh of that page's
xml instance. I think that it has something to do with the way Firefox
cache's and retrieves info on a previously viewed page, because it
acts suspiciously like a page does when you navigate via the back
button rather than through a websites menu. Maybe I can set the page
up not to cache (if anyone knows how to do that, let me know).

I know you guys are shooting in the dark. So I think I'll try to make
a bare bones test case and give it a couple of runs and then if I
can't figure it out you can have something to look at. It might take
me a couple weeks cause I just had some more important database issues
crop up that I"m working on (unrelated), either way I'll let you know.
_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms