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/index">a link</a>
being displayed in the flash message instead of a clickable link
this was tested on web2py 1.99.2
Am I missing something?
2012/8/29 Claudio Zambaldi <[email protected]>:
> 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/index">a link</a>
>
> being displyed in the flash message instead of a clickable link
>
> this was tested on web2py 1.99.2
>
> Am I missing something?
>
>
>
> 2012/8/29 Anthony <[email protected]>:
>> 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="%s">click me</a>' % URL(...))
>>
>> The problem with including a link, though, is that using the current
>> scaffolding app and web2py.js, clicking on the flash message causes it to
>> hide, but the click won't register on the link. You would probably have to
>> hack web2py.js or otherwise add some JS code to override the flash click
>> handler in order to avoid that behavior.
>>
>> Anthony
>>
>>
>> On Tuesday, August 28, 2012 7:15:26 PM UTC-4, czamb wrote:
>>>
>>> Is it possible to get some html content into the session.flash message?
>>> I would like to include an "undo" link for a delete action.
>>> Could also be nice to easily access newly created content.
>>> Thank you.
>>
>> --
>>
>>
>>
>
>
>
> --
> Claudio Zambaldi :: 0176-50123077 :: http://zambaldi.de
--
Claudio Zambaldi :: 0176-50123077 :: http://zambaldi.de
--