On Tue, Apr 30, 2013 at 5:44 PM, Bertrand Guay-Paquet <
ber...@step.polymtl.ca> wrote:

> Hi,
>
> This is not the behavior I'm getting. I created a stateless page with this:
>
>         add(new FencedFeedbackPanel("feedback"**));
>         add(new StatelessLink<Void>("success") {
>             @Override
>             public void onClick() {
>                 getSession().info("Success message (without bind())");
>                 setResponsePage(**SessionMessagePage.class);
>             }
>         });
>         add(new StatelessLink<Void>("**successBind") {
>             @Override
>             public void onClick() {
>                 getSession().bind();
>                 getSession().info("Success message (with bind())");
>                 setResponsePage(**SessionMessagePage.class);
>             }
>         });
>
> The "success" link does not display a session message in the feedback
> panel if the session is temporary. It does work when the session is bound
> however.
>
> I stepped inside FenceFeedbackPanel#**newFeedbackMessagesModel() and
> compared the Session object returned by getSession() there and in the
> "success" link. They are not the same java object.


Put a breakpoint in MyApplication#newSession() and see where the session is
created the second time


>
>
> On 30/04/2013 7:07 AM, Martin Grigorov wrote:
>
>> Hi,
>>
>> Wicket uses temporary Sessions for stateless application.
>> Adding a feedback message to such session will live till the end of the
>> current request. Since the response page is rendered in the same
>> request/response cycle the feedback messages should be still reachable.
>>
>>
>>
>> On Mon, Apr 29, 2013 at 11:41 PM, Bertrand Guay-Paquet <
>> ber...@step.polymtl.ca> wrote:
>>
>>  Hello,
>>>
>>> When using the Sessions info(), error() and success() methods, and the
>>> session is not bound, the messages are lost. This can happen easily when
>>> on
>>> stateless pages. The fix for this is easy: I need to make sure the
>>> session
>>> is bound and call Session.bind().
>>>
>>> However, I think it would be nice for the Session to get bound
>>> automatically when adding messages to it. Otherwise, the messages are
>>> silently discarded and the cause is not so obvious. What do you think,
>>> should I open an issue for this?
>>>
>>> Regards,
>>> Bertrand
>>>
>>> ------------------------------****----------------------------**
>>> --**---------
>>> To unsubscribe, e-mail: 
>>> users-unsubscribe@wicket.**apa**che.org<http://apache.org>
>>> <users-unsubscribe@**wicket.apache.org<users-unsubscr...@wicket.apache.org>
>>> >
>>>
>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>
>>>
>>>
>>
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: 
> users-unsubscribe@wicket.**apache.org<users-unsubscr...@wicket.apache.org>
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


-- 
Martin Grigorov
Wicket Training & Consulting
http://jWeekend.com <http://jweekend.com/>

Reply via email to