Hi, Bob,
Thank you for your reply, and sorry if i didn't make myself clear.
In my case, I can the message displayed in multiple responses.
Now i think back, what you are saying makes a lot of sense, I see this
problem probably because the page was set to stateful(to enable pagination).

Thanks
Yinghai

On Fri, Nov 5, 2010 at 5:21 AM, Bob Schellink <[email protected]> wrote:

> Greetings Hai,
>
> On 5/11/2010 08:11, Yinghai Zhao wrote:
> > Hello,
> > I'm new to Click and writing my first Click web app.
> > I'm wondering what is the best practice to display an error message on a
> page.
> > Currently, I used a bindable String "msg" in may base page class, and a
> msg tag in my template.
> > When needed, I just set a value to a "msg" and it get displayed in the
> page.
> >
> > Then I realize that this is not the best way(actually a silly way) to do
> this, since the message
> > will be passed through multiple response(and displayed multiple times).
>
> Not sure I understand what you mean here. Why do you see  multiple
> responses? Click Pages are
> stateless, so your initial assumption (using @Bindable msg) sounds fine to
> me?
>
> As Malcolm mentioned, Flash messages is a good way to display messages when
> using Redirects.
>
> Kind regards
>
> Bob
>

Reply via email to