You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Patrick Casey <pa...@adelphia.net> on 2005/05/16 03:18:29 UTC

Brain Freeze

 

            I'm brain frozen on something that should be drop dead simple
and I was hoping somebody could help me out.

 

            I have a component. It is made up of some "normal" tapestry
stuff, and a big chunk of html that the component class itself emits.

 

            Right now, the renderComponent() method looks like:

 

            Write some stuff

            Super.render(writer, cycle);

 

            Net result is I get a component with "my stuff" on top and the
stuff in the template file beneath it.

 

            Conversely if I do:

 

            Super.render(writer.cycle);

            Write some stuff

 

            I get whatever's in the template html file on top with "my
stuff" on the bottom.

 

            So far, so good, and it's all very logical.

 

            What I'd like to do though is control where in the template "my
stuff" shows up, ideally by using some sort of special tag e.g. I'd like to
be able to have my template look like:

 

            Hello

            <span jwcid="MY STUFF"/>

            World

 

            Or

            Hello World! Here is <span jwcid="MY STUFF" />

 

            This all has to happen though within a single component as, for
historical reasons, I can't just break my component apart and make a
subcomponent called MY STUFF. Can anyone help here? Basically I need the
inverse of renderBody.

 

            --- Pat


RE: Brain Freeze

Posted by Patrick Casey <pa...@adelphia.net>.
	It's fairly complex, but I already had the code around to write it
out to an HTMLWriter, so it was like 5 lines of code to construct an
HTMLWriter from a stringwriter and use the exact same code.

	--- Pat

> -----Original Message-----
> From: Robert Zeigler [mailto:robertz@scazdl.org]
> Sent: Sunday, May 15, 2005 8:04 PM
> To: Tapestry users
> Subject: Re: Brain Freeze
> 
> Depending on the complexity of what you're inserting/doing,
> you might also consider looking into block & renderBlock.
> 
> Robert
> 
> Patrick Casey wrote:
> > 	<smacks head>
> >
> > 	Yep, that should work great, thanks!
> >
> > 	--- Pat
> >
<snip>



---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Brain Freeze

Posted by Robert Zeigler <ro...@scazdl.org>.
Depending on the complexity of what you're inserting/doing,
you might also consider looking into block & renderBlock.

Robert

Patrick Casey wrote:
> 	<smacks head>
> 
> 	Yep, that should work great, thanks!
> 
> 	--- Pat
> 
> 
>>-----Original Message-----
>>From: Konstantin Iignatyev [mailto:kgignatyev@yahoo.com]
>>Sent: Sunday, May 15, 2005 6:27 PM
>>To: Tapestry users
>>Subject: Re: Brain Freeze
>>
>>Looks like all you need is
>>
>>Hello
>><span jwcid="@InsertText" value="ognl:myStuff"/>
>>
>>And your component should have method String getMyStuff()
>>
>>
>>Patrick Casey wrote:
>>
>>
>>>
>>>           I'm brain frozen on something that should be drop dead simple
>>>and I was hoping somebody could help me out.
>>>
>>>
>>>
>>>           I have a component. It is made up of some "normal" tapestry
>>>stuff, and a big chunk of html that the component class itself emits.
>>>
>>>
>>>
>>>           Right now, the renderComponent() method looks like:
>>>
>>>
>>>
>>>           Write some stuff
>>>
>>>           Super.render(writer, cycle);
>>>
>>>
>>>
>>>           Net result is I get a component with "my stuff" on top and
>>
>>the
>>
>>>stuff in the template file beneath it.
>>>
>>>
>>>
>>>           Conversely if I do:
>>>
>>>
>>>
>>>           Super.render(writer.cycle);
>>>
>>>           Write some stuff
>>>
>>>
>>>
>>>           I get whatever's in the template html file on top with "my
>>>stuff" on the bottom.
>>>
>>>
>>>
>>>           So far, so good, and it's all very logical.
>>>
>>>
>>>
>>>           What I'd like to do though is control where in the template
>>
>>"my
>>
>>>stuff" shows up, ideally by using some sort of special tag e.g. I'd like
>>
>>to
>>
>>>be able to have my template look like:
>>>
>>>
>>>
>>>           Hello
>>>
>>>           <span jwcid="MY STUFF"/>
>>>
>>>           World
>>>
>>>
>>>
>>>           Or
>>>
>>>           Hello World! Here is <span jwcid="MY STUFF" />
>>>
>>>
>>>
>>>           This all has to happen though within a single component as,
>>
>>for
>>
>>>historical reasons, I can't just break my component apart and make a
>>>subcomponent called MY STUFF. Can anyone help here? Basically I need the
>>>inverse of renderBody.
>>>
>>>
>>>
>>>           --- Pat
>>>
>>>
>>>
>>>
>>
>>
>>--
>>Thanks,
>>
>>Konstantin Ignatyev
>>
>>http://www.kgionline.com
>>
>>
>>
>>
>>
>>PS: If this is a typical day on planet earth, humans will add fifteen
>>million tons of carbon to the atmosphere, destroy 115 square miles of
>>tropical rainforest, create seventy-two miles of desert, eliminate between
>>forty to one hundred species, erode seventy-one million tons of topsoil,
>>add 2.700 tons of CFCs to the stratosphere, and increase their population
>>by 263.000
>>
>>Bowers, C.A.  The Culture of Denial:
>>Why the Environmental Movement Needs a Strategy for Reforming Universities
>>and Public Schools.
>>New York:  State University of New York Press, 1997: (4) (5) (p.206)
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


RE: Brain Freeze

Posted by Patrick Casey <pa...@adelphia.net>.
	<smacks head>

	Yep, that should work great, thanks!

	--- Pat

> -----Original Message-----
> From: Konstantin Iignatyev [mailto:kgignatyev@yahoo.com]
> Sent: Sunday, May 15, 2005 6:27 PM
> To: Tapestry users
> Subject: Re: Brain Freeze
> 
> Looks like all you need is
> 
> Hello
> <span jwcid="@InsertText" value="ognl:myStuff"/>
> 
> And your component should have method String getMyStuff()
> 
> 
> Patrick Casey wrote:
> 
> >
> >
> >            I'm brain frozen on something that should be drop dead simple
> >and I was hoping somebody could help me out.
> >
> >
> >
> >            I have a component. It is made up of some "normal" tapestry
> >stuff, and a big chunk of html that the component class itself emits.
> >
> >
> >
> >            Right now, the renderComponent() method looks like:
> >
> >
> >
> >            Write some stuff
> >
> >            Super.render(writer, cycle);
> >
> >
> >
> >            Net result is I get a component with "my stuff" on top and
> the
> >stuff in the template file beneath it.
> >
> >
> >
> >            Conversely if I do:
> >
> >
> >
> >            Super.render(writer.cycle);
> >
> >            Write some stuff
> >
> >
> >
> >            I get whatever's in the template html file on top with "my
> >stuff" on the bottom.
> >
> >
> >
> >            So far, so good, and it's all very logical.
> >
> >
> >
> >            What I'd like to do though is control where in the template
> "my
> >stuff" shows up, ideally by using some sort of special tag e.g. I'd like
> to
> >be able to have my template look like:
> >
> >
> >
> >            Hello
> >
> >            <span jwcid="MY STUFF"/>
> >
> >            World
> >
> >
> >
> >            Or
> >
> >            Hello World! Here is <span jwcid="MY STUFF" />
> >
> >
> >
> >            This all has to happen though within a single component as,
> for
> >historical reasons, I can't just break my component apart and make a
> >subcomponent called MY STUFF. Can anyone help here? Basically I need the
> >inverse of renderBody.
> >
> >
> >
> >            --- Pat
> >
> >
> >
> >
> 
> 
> --
> Thanks,
> 
> Konstantin Ignatyev
> 
> http://www.kgionline.com
> 
> 
> 
> 
> 
> PS: If this is a typical day on planet earth, humans will add fifteen
> million tons of carbon to the atmosphere, destroy 115 square miles of
> tropical rainforest, create seventy-two miles of desert, eliminate between
> forty to one hundred species, erode seventy-one million tons of topsoil,
> add 2.700 tons of CFCs to the stratosphere, and increase their population
> by 263.000
> 
> Bowers, C.A.  The Culture of Denial:
> Why the Environmental Movement Needs a Strategy for Reforming Universities
> and Public Schools.
> New York:  State University of New York Press, 1997: (4) (5) (p.206)
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Brain Freeze

Posted by Konstantin Iignatyev <kg...@yahoo.com>.
Looks like all you need is

Hello
<span jwcid="@InsertText" value="ognl:myStuff"/>

And your component should have method String getMyStuff()


Patrick Casey wrote:

> 
>
>            I'm brain frozen on something that should be drop dead simple
>and I was hoping somebody could help me out.
>
> 
>
>            I have a component. It is made up of some "normal" tapestry
>stuff, and a big chunk of html that the component class itself emits.
>
> 
>
>            Right now, the renderComponent() method looks like:
>
> 
>
>            Write some stuff
>
>            Super.render(writer, cycle);
>
> 
>
>            Net result is I get a component with "my stuff" on top and the
>stuff in the template file beneath it.
>
> 
>
>            Conversely if I do:
>
> 
>
>            Super.render(writer.cycle);
>
>            Write some stuff
>
> 
>
>            I get whatever's in the template html file on top with "my
>stuff" on the bottom.
>
> 
>
>            So far, so good, and it's all very logical.
>
> 
>
>            What I'd like to do though is control where in the template "my
>stuff" shows up, ideally by using some sort of special tag e.g. I'd like to
>be able to have my template look like:
>
> 
>
>            Hello
>
>            <span jwcid="MY STUFF"/>
>
>            World
>
> 
>
>            Or
>
>            Hello World! Here is <span jwcid="MY STUFF" />
>
> 
>
>            This all has to happen though within a single component as, for
>historical reasons, I can't just break my component apart and make a
>subcomponent called MY STUFF. Can anyone help here? Basically I need the
>inverse of renderBody.
>
> 
>
>            --- Pat
>
>
>  
>


-- 
Thanks,

Konstantin Ignatyev

http://www.kgionline.com





PS: If this is a typical day on planet earth, humans will add fifteen million tons of carbon to the atmosphere, destroy 115 square miles of tropical rainforest, create seventy-two miles of desert, eliminate between forty to one hundred species, erode seventy-one million tons of topsoil, add 2.700 tons of CFCs to the stratosphere, and increase their population by 263.000

Bowers, C.A.  The Culture of Denial:  
Why the Environmental Movement Needs a Strategy for Reforming Universities and Public Schools.  
New York:  State University of New York Press, 1997: (4) (5) (p.206)


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org