You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Thomas Lutz <ma...@gmx.at> on 2007/12/19 10:21:46 UTC

FeedbackPanel and page refresh (f5) after submit

Hi,

First of all, great framework !

I've a form with some validation added, nothing special (Required, Email 
check). When I submit the form I get the validation messages in the 
FeedbackPanel as expected, but :-), hitting f5 for a page refresh after 
the submit removes them (don't ask why refresh after submit... users of 
my webapp do stuff like this :-)).
The form is not submitted, only redisplayed, but the validation messages 
are missing.
Is there something I can do about this ?

Thanks in advance,
Tom

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: FeedbackPanel and page refresh (f5) after submit

Posted by James Carman <ja...@carmanconsulting.com>.
Right, I don't know what the exact settings were, but my IE version
automatically did a refresh on a page when FF didn't (this is my vague
recollection).  I don't typically do a whole lot of tweaking of my
browser settings.  I'm way too lazy for that.

On Thu, Jun 26, 2008 at 10:15 PM, Timo Rantalaiho <Ti...@ri.fi> wrote:
> On Thu, 26 Jun 2008, James Carman wrote:
>> Well, IE actually does refresh the page in certain situations, I've
>> seen.  Firefox doesn't have this problem at least in my experience.
>
> It depends on the cache settings of the browser and the
> relevant headers sent by the page.
>
> Best wishes,
> Timo
>
> --
> Timo Rantalaiho
> Reaktor Innovations Oy    <URL: http://www.ri.fi/ >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: FeedbackPanel and page refresh (f5) after submit

Posted by Timo Rantalaiho <Ti...@ri.fi>.
On Thu, 26 Jun 2008, James Carman wrote:
> Well, IE actually does refresh the page in certain situations, I've
> seen.  Firefox doesn't have this problem at least in my experience.

It depends on the cache settings of the browser and the 
relevant headers sent by the page.

Best wishes,
Timo

-- 
Timo Rantalaiho           
Reaktor Innovations Oy    <URL: http://www.ri.fi/ >

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: FeedbackPanel and page refresh (f5) after submit

Posted by James Carman <ja...@carmanconsulting.com>.
Well, IE actually does refresh the page in certain situations, I've
seen.  Firefox doesn't have this problem at least in my experience.

On Thu, Jun 26, 2008 at 12:00 PM, Igor Vaynberg <ig...@gmail.com> wrote:
> this has nothing to do with versioning. when you press the back button
> in the browser there shouldnt even be a hit to the serverside, the
> browser simply pulls what it thinks the last page is out of its cache.
>
> -igor
>
> On Thu, Jun 26, 2008 at 12:36 AM, Benny Weingarten
> <be...@myworklight.com> wrote:
>>
>> I am fronting a similar problem. My users don't refresh, they go back and
>> forward using the browser's back and forward buttons.
>>
>> In my wicket application, I have a FeedbackPanel in my page that displays
>> error or success, depending on whether the form submitted successfully or
>> not. My Form is a personal information edit form, in which a user can change
>> information about themselves (such as name, interests, hobbies, etc`..)
>>
>> Lets say a user does the following in the form:
>> 1) changes a hobby, submit the form (success). A success message is
>> idsplayed via the FeedbackPanel
>> 2) blanks the name field, submit the form (failure. In wicket terms, the
>> validation failed on the TexfField Model object, and the Form's onError
>> method was called) an error message displayed via the Feedback Panel
>> 3) changes the name field to a valid name, then submit.  (success). A
>> success message is displayed via the FeedbackPanel
>>
>> At this point, if the user clicks on the browser's back button, I would
>> expect the form to be visible with the erroneous "name" field, and the error
>> message. However, the form is displayed with the value entered at (3),
>> without any error message.
>>
>> User clicks back again and I would expect the form to display the new hobby
>> field, with the success message from (1).  What I see is the same page as
>> after (3), with no feedback message.
>>
>> Its as if once I submit the form, the previous values of the form are not
>> retained. I am calling setVersioned(true) on the form, and according to the
>> docuumentation that should make the form retian previous states, but it
>> doesn't seem to work.
>> Suggestions?
>>
>>
>> SantiagoA wrote:
>>>
>>> feedbackMessages are stored to show them once, aftewards they were
>>> deleted. Perhaps, try to store them in your own List and feed the
>>> FeedbackPanel with the List when the page is displayed again. Maybe this
>>> work, i´m not sure about that. ;-)
>>>
>>> -Santiago
>>>
>>>
>>> Thomas Lutz wrote:
>>>>
>>>> Hi,
>>>>
>>>> First of all, great framework !
>>>>
>>>> I've a form with some validation added, nothing special (Required, Email
>>>> check). When I submit the form I get the validation messages in the
>>>> FeedbackPanel as expected, but :-), hitting f5 for a page refresh after
>>>> the submit removes them (don't ask why refresh after submit... users of
>>>> my webapp do stuff like this :-)).
>>>> The form is not submitted, only redisplayed, but the validation messages
>>>> are missing.
>>>> Is there something I can do about this ?
>>>>
>>>> Thanks in advance,
>>>> Tom
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>
>>>>
>>>>
>>>
>>>
>>
>> --
>> View this message in context: http://www.nabble.com/FeedbackPanel-and-page-refresh-%28f5%29-after-submit-tp14413642p18128149.html
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: FeedbackPanel and page refresh (f5) after submit

Posted by Igor Vaynberg <ig...@gmail.com>.
this has nothing to do with versioning. when you press the back button
in the browser there shouldnt even be a hit to the serverside, the
browser simply pulls what it thinks the last page is out of its cache.

-igor

On Thu, Jun 26, 2008 at 12:36 AM, Benny Weingarten
<be...@myworklight.com> wrote:
>
> I am fronting a similar problem. My users don't refresh, they go back and
> forward using the browser's back and forward buttons.
>
> In my wicket application, I have a FeedbackPanel in my page that displays
> error or success, depending on whether the form submitted successfully or
> not. My Form is a personal information edit form, in which a user can change
> information about themselves (such as name, interests, hobbies, etc`..)
>
> Lets say a user does the following in the form:
> 1) changes a hobby, submit the form (success). A success message is
> idsplayed via the FeedbackPanel
> 2) blanks the name field, submit the form (failure. In wicket terms, the
> validation failed on the TexfField Model object, and the Form's onError
> method was called) an error message displayed via the Feedback Panel
> 3) changes the name field to a valid name, then submit.  (success). A
> success message is displayed via the FeedbackPanel
>
> At this point, if the user clicks on the browser's back button, I would
> expect the form to be visible with the erroneous "name" field, and the error
> message. However, the form is displayed with the value entered at (3),
> without any error message.
>
> User clicks back again and I would expect the form to display the new hobby
> field, with the success message from (1).  What I see is the same page as
> after (3), with no feedback message.
>
> Its as if once I submit the form, the previous values of the form are not
> retained. I am calling setVersioned(true) on the form, and according to the
> docuumentation that should make the form retian previous states, but it
> doesn't seem to work.
> Suggestions?
>
>
> SantiagoA wrote:
>>
>> feedbackMessages are stored to show them once, aftewards they were
>> deleted. Perhaps, try to store them in your own List and feed the
>> FeedbackPanel with the List when the page is displayed again. Maybe this
>> work, i´m not sure about that. ;-)
>>
>> -Santiago
>>
>>
>> Thomas Lutz wrote:
>>>
>>> Hi,
>>>
>>> First of all, great framework !
>>>
>>> I've a form with some validation added, nothing special (Required, Email
>>> check). When I submit the form I get the validation messages in the
>>> FeedbackPanel as expected, but :-), hitting f5 for a page refresh after
>>> the submit removes them (don't ask why refresh after submit... users of
>>> my webapp do stuff like this :-)).
>>> The form is not submitted, only redisplayed, but the validation messages
>>> are missing.
>>> Is there something I can do about this ?
>>>
>>> Thanks in advance,
>>> Tom
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>>
>>
>>
>
> --
> View this message in context: http://www.nabble.com/FeedbackPanel-and-page-refresh-%28f5%29-after-submit-tp14413642p18128149.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: FeedbackPanel and page refresh (f5) after submit

Posted by Benny Weingarten <be...@myworklight.com>.
I am fronting a similar problem. My users don't refresh, they go back and
forward using the browser's back and forward buttons.

In my wicket application, I have a FeedbackPanel in my page that displays
error or success, depending on whether the form submitted successfully or
not. My Form is a personal information edit form, in which a user can change
information about themselves (such as name, interests, hobbies, etc`..)

Lets say a user does the following in the form:
1) changes a hobby, submit the form (success). A success message is
idsplayed via the FeedbackPanel
2) blanks the name field, submit the form (failure. In wicket terms, the
validation failed on the TexfField Model object, and the Form's onError
method was called) an error message displayed via the Feedback Panel
3) changes the name field to a valid name, then submit.  (success). A
success message is displayed via the FeedbackPanel

At this point, if the user clicks on the browser's back button, I would
expect the form to be visible with the erroneous "name" field, and the error
message. However, the form is displayed with the value entered at (3),
without any error message.

User clicks back again and I would expect the form to display the new hobby
field, with the success message from (1).  What I see is the same page as
after (3), with no feedback message.

Its as if once I submit the form, the previous values of the form are not
retained. I am calling setVersioned(true) on the form, and according to the
docuumentation that should make the form retian previous states, but it
doesn't seem to work. 
Suggestions?


SantiagoA wrote:
> 
> feedbackMessages are stored to show them once, aftewards they were
> deleted. Perhaps, try to store them in your own List and feed the
> FeedbackPanel with the List when the page is displayed again. Maybe this
> work, i´m not sure about that. ;-)
> 
> -Santiago
> 
> 
> Thomas Lutz wrote:
>> 
>> Hi,
>> 
>> First of all, great framework !
>> 
>> I've a form with some validation added, nothing special (Required, Email 
>> check). When I submit the form I get the validation messages in the 
>> FeedbackPanel as expected, but :-), hitting f5 for a page refresh after 
>> the submit removes them (don't ask why refresh after submit... users of 
>> my webapp do stuff like this :-)).
>> The form is not submitted, only redisplayed, but the validation messages 
>> are missing.
>> Is there something I can do about this ?
>> 
>> Thanks in advance,
>> Tom
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/FeedbackPanel-and-page-refresh-%28f5%29-after-submit-tp14413642p18128149.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: FeedbackPanel and page refresh (f5) after submit

Posted by SantiagoA <s....@gmx.de>.
feedbackMessages are stored to show them once, aftewards they were deleted.
Perhaps, try to store them in your own List and feed the FeedbackPanel with
the List when the page is displayed again. Maybe this work, i´m not sure
about that. ;-)

-Santiago


Thomas Lutz wrote:
> 
> Hi,
> 
> First of all, great framework !
> 
> I've a form with some validation added, nothing special (Required, Email 
> check). When I submit the form I get the validation messages in the 
> FeedbackPanel as expected, but :-), hitting f5 for a page refresh after 
> the submit removes them (don't ask why refresh after submit... users of 
> my webapp do stuff like this :-)).
> The form is not submitted, only redisplayed, but the validation messages 
> are missing.
> Is there something I can do about this ?
> 
> Thanks in advance,
> Tom
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/FeedbackPanel-and-page-refresh-%28f5%29-after-submit-tp14413642p14416157.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: FeedbackPanel and page refresh (f5) after submit

Posted by Ajayi Yinka <ia...@googlemail.com>.
Hurray, i have got over it. The problem I was having is that, I forgort to
implement the cleanupFeedbackMessages() method which I declare in my session
class. I called the method but forgot to put the codes therein. thanks so
much.
Now, i can continue with my app.
I will appreciate it if anyone can give me a simplest way of implement
jasper report with wicket.

Regards,
Yinka.


On Thu, Sep 11, 2008 at 9:26 PM, Igor Vaynberg <ig...@gmail.com>wrote:

> here is how it works:
>
> if the message is reported against session it is held until rendered,
> if the message is reported against a component it is held only during
> the request in which it has been reported. wicket is smart enough to
> look at the render strategy and not clear messages during the redirect
> between post and get, so i am not sure why this is not working for you
> as it is working fine in the forminput wicket example.
>
> if you want to change this behavior you can override
> session.cleanupFeedbackMessages() and implement whatever behavior you
> wish.
> by the way, this is all very apparent from the code. i suggest you
> learn your ide and useful ide tools such as call hieararchy,
> ctrl+click to follow, etc.
>
> -igor
>
> On Thu, Sep 11, 2008 at 8:43 PM, Timo Rantalaiho <Ti...@ri.fi>
> wrote:
> > On Thu, 11 Sep 2008, Ajayi Yinka wrote:
> >> > Thomas Lutz wrote:
> >> > >
> >> > > I've a form with some validation added, nothing special (Required,
> Email
> >> > > check). When I submit the form I get the validation messages in the
> >> > > FeedbackPanel as expected, but :-), hitting f5 for a page refresh
> after
> >> > > the submit removes them (don't ask why refresh after submit... users
> of
> >> > > my webapp do stuff like this :-)).
> >> > > The form is not submitted, only redisplayed, but the validation
> messages
> >> > > are missing.
> >> > > Is there something I can do about this ?
> >
> > I think that what happens is that
> >
> > a) the normal POST
> >
> > b) the redirect to GET after POST [1]
> >
> > c) feedback messages are cleared from session on detaching
> >   the request [2]
> >
> > d) refresh does the GET again, and the flash feedback
> >   messages cannot be displayed, because they are already
> >   cleared from the session
> >
> > The solution is left as an exercise for the reader ;)
> > Because now I must get going...
> >
> > Best wishes,
> > Timo
> >
> >
> > [1] http://en.wikipedia.org/wiki/Post/Redirect/Get
> > [2]
> >
> http://fisheye6.atlassian.com/browse/wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/RequestCycle.java?r=645227#l1058
> >
> > --
> > Timo Rantalaiho
> > Reaktor Innovations Oy    <URL: http://www.ri.fi/ >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: FeedbackPanel and page refresh (f5) after submit

Posted by Igor Vaynberg <ig...@gmail.com>.
here is how it works:

if the message is reported against session it is held until rendered,
if the message is reported against a component it is held only during
the request in which it has been reported. wicket is smart enough to
look at the render strategy and not clear messages during the redirect
between post and get, so i am not sure why this is not working for you
as it is working fine in the forminput wicket example.

if you want to change this behavior you can override
session.cleanupFeedbackMessages() and implement whatever behavior you
wish.
by the way, this is all very apparent from the code. i suggest you
learn your ide and useful ide tools such as call hieararchy,
ctrl+click to follow, etc.

-igor

On Thu, Sep 11, 2008 at 8:43 PM, Timo Rantalaiho <Ti...@ri.fi> wrote:
> On Thu, 11 Sep 2008, Ajayi Yinka wrote:
>> > Thomas Lutz wrote:
>> > >
>> > > I've a form with some validation added, nothing special (Required, Email
>> > > check). When I submit the form I get the validation messages in the
>> > > FeedbackPanel as expected, but :-), hitting f5 for a page refresh after
>> > > the submit removes them (don't ask why refresh after submit... users of
>> > > my webapp do stuff like this :-)).
>> > > The form is not submitted, only redisplayed, but the validation messages
>> > > are missing.
>> > > Is there something I can do about this ?
>
> I think that what happens is that
>
> a) the normal POST
>
> b) the redirect to GET after POST [1]
>
> c) feedback messages are cleared from session on detaching
>   the request [2]
>
> d) refresh does the GET again, and the flash feedback
>   messages cannot be displayed, because they are already
>   cleared from the session
>
> The solution is left as an exercise for the reader ;)
> Because now I must get going...
>
> Best wishes,
> Timo
>
>
> [1] http://en.wikipedia.org/wiki/Post/Redirect/Get
> [2]
> http://fisheye6.atlassian.com/browse/wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/RequestCycle.java?r=645227#l1058
>
> --
> Timo Rantalaiho
> Reaktor Innovations Oy    <URL: http://www.ri.fi/ >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: FeedbackPanel and page refresh (f5) after submit

Posted by Timo Rantalaiho <Ti...@ri.fi>.
On Thu, 11 Sep 2008, Ajayi Yinka wrote:
> > Thomas Lutz wrote:
> > >
> > > I've a form with some validation added, nothing special (Required, Email
> > > check). When I submit the form I get the validation messages in the
> > > FeedbackPanel as expected, but :-), hitting f5 for a page refresh after
> > > the submit removes them (don't ask why refresh after submit... users of
> > > my webapp do stuff like this :-)).
> > > The form is not submitted, only redisplayed, but the validation messages
> > > are missing.
> > > Is there something I can do about this ?

I think that what happens is that

a) the normal POST

b) the redirect to GET after POST [1]

c) feedback messages are cleared from session on detaching 
   the request [2]

d) refresh does the GET again, and the flash feedback
   messages cannot be displayed, because they are already 
   cleared from the session

The solution is left as an exercise for the reader ;) 
Because now I must get going...

Best wishes,
Timo


[1] http://en.wikipedia.org/wiki/Post/Redirect/Get 
[2]
http://fisheye6.atlassian.com/browse/wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/RequestCycle.java?r=645227#l1058

-- 
Timo Rantalaiho           
Reaktor Innovations Oy    <URL: http://www.ri.fi/ >

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: FeedbackPanel and page refresh (f5) after submit

Posted by Ajayi Yinka <ia...@googlemail.com>.
this is exacltly the same problem I am having. Could anyone render any
solution to this.

Thanks
Yinka.

On Thu, Sep 11, 2008 at 7:40 AM, kayce <sk...@gmail.com> wrote:

>
> Did you find a solution for this?
> Thanks
>
>
> Thomas Lutz wrote:
> >
> > I've a form with some validation added, nothing special (Required, Email
> > check). When I submit the form I get the validation messages in the
> > FeedbackPanel as expected, but :-), hitting f5 for a page refresh after
> > the submit removes them (don't ask why refresh after submit... users of
> > my webapp do stuff like this :-)).
> > The form is not submitted, only redisplayed, but the validation messages
> > are missing.
> > Is there something I can do about this ?
> >
> > Thanks in advance,
> > Tom
> >
>
> --
> View this message in context:
> http://www.nabble.com/FeedbackPanel-and-page-refresh-%28f5%29-after-submit-tp14413642p19436382.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: FeedbackPanel and page refresh (f5) after submit

Posted by kayce <sk...@gmail.com>.
Did you find a solution for this?
Thanks


Thomas Lutz wrote:
> 
> I've a form with some validation added, nothing special (Required, Email 
> check). When I submit the form I get the validation messages in the 
> FeedbackPanel as expected, but :-), hitting f5 for a page refresh after 
> the submit removes them (don't ask why refresh after submit... users of 
> my webapp do stuff like this :-)).
> The form is not submitted, only redisplayed, but the validation messages 
> are missing.
> Is there something I can do about this ?
> 
> Thanks in advance,
> Tom
> 

-- 
View this message in context: http://www.nabble.com/FeedbackPanel-and-page-refresh-%28f5%29-after-submit-tp14413642p19436382.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org