Since this became pertinent to my needs recently, I made the following
change to web2py.js (currently line 42) to only close the flash message
when clicking on the x (span):
before:
doc.on('click', '.flash', function(e){var t=jQuery(this);
if(t.css('top')=='0px') t.slideUp('slow'); else
Yes, session.flash can be HTML -- you can use web2py HTML helpers or put
raw HTML code inside XML(), and it should be rendered properly.
session.flash = A('click me', _href=URL(...))
or
session.flash = XML('a href=%sclick me/a' % URL(...))
The problem with including a link, though, is that
Anthony, thanks for your reply.
XML doesn't seem to render to html but to string.
The following two lines in the welcome app index:
session.flag= not (session.flag)
session.flash=XML(A('a link',URL('index')))
result in the string
a href=/welcome/default/indexa link/a
being displyed in
sorry, that should read:
XML doesn't seem to render to html but to string.
The following line in the welcome app index:
session.flash=XML(A('a link',URL('index')))
result in the string
a href=/welcome/default/indexa link/a
being displayed in the flash message instead of a clickable link
Read Anthony's message again. It can be either XML or A, not both. Note he
also says that you won't be able to click the link anyway.
On Wednesday, August 29, 2012 2:21:59 PM UTC-7, Claudio Zambaldi wrote:
sorry, that should read:
XML doesn't seem to render to html but to string.
The
Thanks, I focused too much on the XML syntax.
session.flash=DIV('Item deleted. ',A('(undo)',_href=URL('undo_func')))
works and renders to html with a hyperlink.
However,
session.flash=XML('a href=%sclick me/a' % URL('index'))
still renders to a string instead of html, feels like unexpected
However,
session.flash=XML('a href=%sclick me/a' % URL('index'))
still renders to a string instead of html, feels like unexpected behavior
to me.
It works with response.flash but not session.flash. This is because html.py
includes the following code:
### important to allow safe
7 matches
Mail list logo