Re: Conditional wrapping html element

2013-08-07 Thread Thiago H de Paula Figueiredo
On Wed, 07 Aug 2013 06:33:14 -0300, Nathan Quirynen wrote: Hi, Hi! If this is a common case, I'd write a mixin for that. -- Thiago H. de Paula Figueiredo - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org Fo

Re: Conditional wrapping html element

2013-08-07 Thread Lance Java
Nice! Much less hacky than my approach. I'm waiting for Thiago's imminent comment regarding :) On 7 Aug 2013 10:56, "Dmitry Gusev" wrote: > Or you can use blocks and delegate: > > > Your content > > > > > > > > > > > > On Wed, Aug 7, 2013 at 1:47 PM

Re: Conditional wrapping html element

2013-08-07 Thread Steve Eynon
You could create a simple component that optionally renders the div element. Something like: public class IfDiv { @Parameter private boolean test; void setupRender(MarkupWriter writer) { if (test) writer.element("div"); } void afterRender(MarkupWriter writer) { if (test) writer.end(

Re: Conditional wrapping html element

2013-08-07 Thread Dmitry Gusev
Or you can use blocks and delegate: Your content On Wed, Aug 7, 2013 at 1:47 PM, Lance Java wrote: > You'll have to use the OutputRaw component or MarkupWriter.writeRaw(...) > > Note that when passing the value parameter to OutputRaw you will need t

Re: Conditional wrapping html element

2013-08-07 Thread Lance Java
You'll have to use the OutputRaw component or MarkupWriter.writeRaw(...) Note that when passing the value parameter to OutputRaw you will need to escape <, > and " On 7 Aug 2013 10:33, "Nathan Quirynen" wrote: > Hi, > > I want to add a div that wraps my content based on a condition: > > >

Conditional wrapping html element

2013-08-07 Thread Nathan Quirynen
Hi, I want to add a div that wraps my content based on a condition: ... content ... This is not possible as it will give following exception: /org.xml.sax.SAXParseException/ /The element type "div" must be terminated by the matching end-tag "". /For my use case I can make a p