[ https://issues.apache.org/jira/browse/TAP5-1863?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13720026#comment-13720026 ]
Howard M. Lewis Ship commented on TAP5-1863: -------------------------------------------- I think it would be nice if we could pass along to the client that the Alert content was pre-formatted (the equivalent of MarkupWriter.writeRaw()). That would support the kind of scenarios you describe. It would be even more effective if the client-side api, the t5/core/alert module, added some flexibility here. > Rendering components in Alerts > ------------------------------ > > Key: TAP5-1863 > URL: https://issues.apache.org/jira/browse/TAP5-1863 > Project: Tapestry 5 > Issue Type: Improvement > Components: tapestry-core > Affects Versions: 5.3.2 > Reporter: Magnus Kvalheim > > We've just upgraded to 5.3.2 and checked out some of the new components. > The Alerts seems pretty useful, but looks like it's only possible to pass on > strings. > I'm thinking a pretty common use-case would be to render some > components/markup in it - like links. > I experimented a little by manually rendering a block and pass that on to > alertManager. Got some inspiration from this thread about rendering blocks - > http://tapestry.1045711.n5.nabble.com/Howto-render-a-block-and-put-it-into-a-JSON-reply-td5486823.html > -------- > RenderCommand renderCommand = (RenderCommand)alertBlock; > MarkupWriter markupWriter = new MarkupWriterImpl(); > RenderQueueImpl renderQueue = new RenderQueueImpl(log); > renderQueue.push(renderCommand); > renderQueue.run(markupWriter); > alertManager.info(markupWriter.toString()); > -------- > That seems to work, but it's a bit clumsy and don't know if it's the > recommended approach for rendering blocks. Does a convenience method exist > for rendering blocks/components? > Not sure if it's possible, but how about if one could pass blocks to alerts > directly. That could be pretty flexible as well... > ######REPLY FROM KALLE###### > Certainly the recommended approach is to use the provided render > queue, rather than create your own - but obviously the current > implementation doesn't always allow to do so. Completely agree with > you that rendering links, and, in general, rendering blocks would be > very useful for alerts. I don't see any major issue why it couldn't be > supported. Please open an issue for it. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira