You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Patrick Davids <pa...@nubologic.com> on 2015/05/05 11:49:11 UTC

Feedback Messages across Requests / Problem

Hi all,

I have have a quite complicated feedback message case here.
Could someone help me, please...

We only want to show a single feedback message.
No matter, how much errors a form validation procudes.

So, I use setMaxMessages(1) on the feedback panel.
To avoid having them all showed up one by one while clicking reload, I 
implemented a FeedbackCollector and do a 
feedbackMessage.markAsRendered() somewhere on detach().
(maybe someone remember my post some months ago ;-) )

This all works pretty good... but:

In a special case I need to use setResponsePage(getPage()) on an 
AjaxRequest, instead of target.add(...).

To add feedback messages across requests, I have to use 
Session.get().error("my error").

But on a ajax request, it seems there is a second detach() more when 
using setResponsePage(), so my message will never get displayed, even 
when I used Session.get().error(...).

I read about a redirect issue, when using setReponsePage() in ajax cases.

Does this redirect accidently marks my messages as rendered, caused by 
an implicit second detach() (-> my own markAsRendered())?

Could some one confirm that? And if yes, is there any way to prevent it?

thanx and kind regards
Patrick

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


Re: Feedback Messages across Requests / Problem

Posted by Patrick Davids <pa...@nubologic.com>.
Hm... yes, already thought about a similar solution, but I would like to 
avoid any custom feedback handlings. I like the way wicket does.

The only custom requierment I have is, just showing 1 message.

I think the problem I is more related to the "across requests" issue in 
combination with "ajax requests".

Any other ideas?

Am 05.05.2015 um 16:12 schrieb Ernesto Reinaldo Barreiro:
> Store messages somewhere else? And on constructor check if there are any
> and add them to the page?
>
> On Tue, May 5, 2015 at 11:49 AM, Patrick Davids <
> patrick.davids@nubologic.com> wrote:
>
>> Hi all,
>>
>> I have have a quite complicated feedback message case here.
>> Could someone help me, please...
>>
>> We only want to show a single feedback message.
>> No matter, how much errors a form validation procudes.
>>
>> So, I use setMaxMessages(1) on the feedback panel.
>> To avoid having them all showed up one by one while clicking reload, I
>> implemented a FeedbackCollector and do a feedbackMessage.markAsRendered()
>> somewhere on detach().
>> (maybe someone remember my post some months ago ;-) )
>>
>> This all works pretty good... but:
>>
>> In a special case I need to use setResponsePage(getPage()) on an
>> AjaxRequest, instead of target.add(...).
>>
>> To add feedback messages across requests, I have to use
>> Session.get().error("my error").
>>
>> But on a ajax request, it seems there is a second detach() more when using
>> setResponsePage(), so my message will never get displayed, even when I used
>> Session.get().error(...).
>>
>> I read about a redirect issue, when using setReponsePage() in ajax cases.
>>
>> Does this redirect accidently marks my messages as rendered, caused by an
>> implicit second detach() (-> my own markAsRendered())?
>>
>> Could some one confirm that? And if yes, is there any way to prevent it?
>>
>> thanx and kind regards
>> Patrick
>>
>> ---------------------------------------------------------------------
>> 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: Feedback Messages across Requests / Problem

Posted by Ernesto Reinaldo Barreiro <re...@gmail.com>.
Store messages somewhere else? And on constructor check if there are any
and add them to the page?

On Tue, May 5, 2015 at 11:49 AM, Patrick Davids <
patrick.davids@nubologic.com> wrote:

> Hi all,
>
> I have have a quite complicated feedback message case here.
> Could someone help me, please...
>
> We only want to show a single feedback message.
> No matter, how much errors a form validation procudes.
>
> So, I use setMaxMessages(1) on the feedback panel.
> To avoid having them all showed up one by one while clicking reload, I
> implemented a FeedbackCollector and do a feedbackMessage.markAsRendered()
> somewhere on detach().
> (maybe someone remember my post some months ago ;-) )
>
> This all works pretty good... but:
>
> In a special case I need to use setResponsePage(getPage()) on an
> AjaxRequest, instead of target.add(...).
>
> To add feedback messages across requests, I have to use
> Session.get().error("my error").
>
> But on a ajax request, it seems there is a second detach() more when using
> setResponsePage(), so my message will never get displayed, even when I used
> Session.get().error(...).
>
> I read about a redirect issue, when using setReponsePage() in ajax cases.
>
> Does this redirect accidently marks my messages as rendered, caused by an
> implicit second detach() (-> my own markAsRendered())?
>
> Could some one confirm that? And if yes, is there any way to prevent it?
>
> thanx and kind regards
> Patrick
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
Regards - Ernesto Reinaldo Barreiro