>
> One question related to the A() callback.
>
> Defining a <div id="some_id"> </div> and adding a target="some_id" to
> the A works very well.
>
> I tried to do session.flash/response.flash inside the callback
> function but it didn't work. Is there a way to do it?
>
> def callback_function():
>    it does some stuff...
>    if s == "1":
>        return something
>    elif s == "2":
>        return something else
>    else:
>        session.flash = "Message"
>        return ???
> Is this possible???


Not like this. The way response.flash works is that the layout.html
includes {{=response.flash}} in a div, and some JS code shows the div. The
callback happens via Ajax and its result simply updates a single element --
it doesn't update the flash div. If you want to add a flash, you'll
probably have to return some JS that will both update the element you want
to update, and update and show the flash div via:

jQuery('.flash').html('your flash message').slideDown();

Anthony

Reply via email to