Re: Rendering components in Alerts
See http://tapestry.1045711.n5.nabble.com/Getting-the-HTML-markup-string-from-a-RenderCommand-td5564418.html On Thursday, 8 March 2012, Magnus Kvalheim wrote: > Thanks Kalle, > > For alerts I created issue: https://issues.apache.org/jira/browse/TAP5-1863 > > > For the more general renderer for blocks: > https://issues.apache.org/jira/browse/TAP5-1864 > > --magnus > > On Wed, Mar 7, 2012 at 8:20 PM, Kalle Korhonen > wrote: > >> On Wed, Mar 7, 2012 at 12:17 AM, Magnus Kvalheim >> wrote: >> > 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 >> > *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... >> >> 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. >> >> Kalle >> >> - >> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org >> For additional commands, e-mail: users-h...@tapestry.apache.org >> >> >
Re: Rendering components in Alerts
Thanks Kalle, For alerts I created issue: https://issues.apache.org/jira/browse/TAP5-1863 For the more general renderer for blocks: https://issues.apache.org/jira/browse/TAP5-1864 --magnus On Wed, Mar 7, 2012 at 8:20 PM, Kalle Korhonen wrote: > On Wed, Mar 7, 2012 at 12:17 AM, Magnus Kvalheim > wrote: > > 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 > > *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... > > 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. > > Kalle > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > >
Re: Rendering components in Alerts
On Wed, Mar 7, 2012 at 12:17 AM, Magnus Kvalheim wrote: > 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 > *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... 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. Kalle - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Rendering components in Alerts
Haha... That's awesome - glad I could help out :) Regarding the alerts. How are you people using it- is it only me that would like to render components with it as well? On Wed, Mar 7, 2012 at 11:28 AM, Lance Java wrote: > Magnus, I think you've just answered my previous threads > > > http://tapestry.1045711.n5.nabble.com/How-does-MultiZoneUpdateEventResultProcessor-get-a-html-string-from-a-RenderCommand-td5518968.html > > > http://tapestry.1045711.n5.nabble.com/tml-parameter-rendered-into-a-JavaScript-string-td5512889.html#a5518439 > > Thanks very much!! > > On Wednesday, 7 March 2012, Magnus Kvalheim wrote: > > Hi Tapestry friends, > > > > 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... > > > > > > Thoughts? > > > > Cheers > > Magnus > > >
Re: Rendering components in Alerts
Magnus, I think you've just answered my previous threads http://tapestry.1045711.n5.nabble.com/How-does-MultiZoneUpdateEventResultProcessor-get-a-html-string-from-a-RenderCommand-td5518968.html http://tapestry.1045711.n5.nabble.com/tml-parameter-rendered-into-a-JavaScript-string-td5512889.html#a5518439 Thanks very much!! On Wednesday, 7 March 2012, Magnus Kvalheim wrote: > Hi Tapestry friends, > > 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... > > > Thoughts? > > Cheers > Magnus >