Re: recursive rendering
public String[] getBlocks() { > > > > > return new String[] { "test", "block1" }; > > > > > } > > > > > > > > > > public Object getBlock() { > > > > > int i = getIndex(); > > > > > setIndex(i + 1); > > > > > return getComponent( getBlocks()[i] ); > > > > > } > > > > > > > > > > Now, this *should* under my understanding (I think there is something > > > > > I > > > > > missing about how tapestry renders and evaluates whether parameters > > > > > have > > > > > been cached) print out "foo bar". But instead it continuously prints > > > > > out > > > > > "foo". If you set a breakpoint in getBlock() it is only called once. > > > > > What am I missing here? > > > > > > > > > > It seems that because the second renderblock is in the template that > > > > > the > > > > > next time that block is rendered, tapestry considers the parameter > > > > > cached and doesn't re-evaluate it. And I don't know of a way to tell > > > > > tapestry not to cache it because obviously I can't change the @Block > > > > > component specification. Any ideas? > > > > > > > > > > On Thu, 2006-08-03 at 19:17 +0530, Karthik N wrote: > > > > > > i've faced a similar problem before try and set cache="false" for > > > > > > your > > > > > > parameters. > > > > > > > > > > > > On 8/3/06, Dan Adams <[EMAIL PROTECTED]> wrote: > > > > > > > > > > > > > > I actually already created an @Eval component that does just > > > > > > > that. The > > > > > > > problem is that the expression that returns the block to render to > > > > > > > @RenderBlock is only evaluated the first time. > > > > > > > > > > > > > > On Wed, 2006-08-02 at 18:19 -0700, Epstein, Ezra wrote: > > > > > > > > This may not be the issue, but... > > > > > > > > > > > > > > > > You could make a "dyna-eval" component that (re-)evaluates an > > > > > > > > ognl > > > > > > > expression wherever/whenever you choose. > > > > > > > > > > > > > > > > OGNL is pretty easy to work with. > > > > > > > > > > > > > > > > Perhaps that could work? > > > > > > > > > > > > > > > > Thanks, > > > > > > > > > > > > > > > > Ezra Epstein > > > > > > > > > > > > > > > > -Original Message- > > > > > > > > From: Dan Adams [mailto:[EMAIL PROTECTED] > > > > > > > > Sent: Wednesday, August 02, 2006 2:31 PM > > > > > > > > To: Tapestry users > > > > > > > > Subject: Re: recursive rendering > > > > > > > > > > > > > > > > Thanks Mike. Yeah, I've read that article at least twice now and > > > > > read > > > > > > > through the code. :) I'm having a problem that you may have run > > > > > > > into; > > > > > much > > > > > > > like your code the block to render is returned via an ognl > > > > > > > expression > > > > > and it > > > > > > > apprears the the expression is only being evaluated once and not > > > > > > > each > > > > > time. > > > > > > > Did you ever have this problem? > > > > > > > > > > > > > > > > On Tue, 2006-08-01 at 16:04 -0700, Mike Henderson wrote: > > > > > > > > > Hi, > > > > > > > > > It's a T3 example but it should show how it's done: > > > > > > > > > > > > > > > > > > > > > > > http://www.behindthesite.com/blog/C1931765677/E923478269/index.html > > > > > > > > > > > > > > > > > > Mike > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > - > > > > > > > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > > > > > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > > > > > > -- > > > > > > > > Dan Adams > > > > > > > > Senior Software Engineer > > > > > > > > Interactive Factory > > > > > > > > 617.235.5857 > > > > > > > > > > > > > > > > > > > > > > > > > > > > > - > > > > > > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > > > > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > > > > > > > > > > - > > > > > > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > > > > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > > > > -- > > > > > > > Dan Adams > > > > > > > Senior Software Engineer > > > > > > > Interactive Factory > > > > > > > 617.235.5857 > > > > > > > > > > > > > > > > > > > > > - > > > > > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > > > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > Dan Adams > > > > > Senior Software Engineer > > > > > Interactive Factory > > > > > 617.235.5857 > > > > > > > > > > > > > > > - > > > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > > > > > > > -- Dan Adams Senior Software Engineer Interactive Factory 617.235.5857 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: recursive rendering
t is only called once. > > > > What am I missing here? > > > > > > > > It seems that because the second renderblock is in the template that the > > > > next time that block is rendered, tapestry considers the parameter > > > > cached and doesn't re-evaluate it. And I don't know of a way to tell > > > > tapestry not to cache it because obviously I can't change the @Block > > > > component specification. Any ideas? > > > > > > > > On Thu, 2006-08-03 at 19:17 +0530, Karthik N wrote: > > > > > i've faced a similar problem before try and set cache="false" for your > > > > > parameters. > > > > > > > > > > On 8/3/06, Dan Adams <[EMAIL PROTECTED]> wrote: > > > > > > > > > > > > I actually already created an @Eval component that does just that. > > > > > > The > > > > > > problem is that the expression that returns the block to render to > > > > > > @RenderBlock is only evaluated the first time. > > > > > > > > > > > > On Wed, 2006-08-02 at 18:19 -0700, Epstein, Ezra wrote: > > > > > > > This may not be the issue, but... > > > > > > > > > > > > > > You could make a "dyna-eval" component that (re-)evaluates an ognl > > > > > > expression wherever/whenever you choose. > > > > > > > > > > > > > > OGNL is pretty easy to work with. > > > > > > > > > > > > > > Perhaps that could work? > > > > > > > > > > > > > > Thanks, > > > > > > > > > > > > > > Ezra Epstein > > > > > > > > > > > > > > -Original Message- > > > > > > > From: Dan Adams [mailto:[EMAIL PROTECTED] > > > > > > > Sent: Wednesday, August 02, 2006 2:31 PM > > > > > > > To: Tapestry users > > > > > > > Subject: Re: recursive rendering > > > > > > > > > > > > > > Thanks Mike. Yeah, I've read that article at least twice now and > > > > read > > > > > > through the code. :) I'm having a problem that you may have run > > > > > > into; > > > > much > > > > > > like your code the block to render is returned via an ognl > > > > > > expression > > > > and it > > > > > > apprears the the expression is only being evaluated once and not > > > > > > each > > > > time. > > > > > > Did you ever have this problem? > > > > > > > > > > > > > > On Tue, 2006-08-01 at 16:04 -0700, Mike Henderson wrote: > > > > > > > > Hi, > > > > > > > > It's a T3 example but it should show how it's done: > > > > > > > > > > > > > > > > > > > > http://www.behindthesite.com/blog/C1931765677/E923478269/index.html > > > > > > > > > > > > > > > > Mike > > > > > > > > > > > > > > > > > > > > > > > > > > > > - > > > > > > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > > > > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > > > > -- > > > > > > > Dan Adams > > > > > > > Senior Software Engineer > > > > > > > Interactive Factory > > > > > > > 617.235.5857 > > > > > > > > > > > > > > > > > > > > > > > > > - > > > > > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > > > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > > > > > > > - > > > > > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > > > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > > -- > > > > > > Dan Adams > > > > > > Senior Software Engineer > > > > > > Interactive Factory > > > > > > 617.235.5857 > > > > > > > > > > > > > > > > > > - > > > > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > Dan Adams > > > > Senior Software Engineer > > > > Interactive Factory > > > > 617.235.5857 > > > > > > > > > > > > - > > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > > > -- Dan Adams Senior Software Engineer Interactive Factory 617.235.5857 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: recursive rendering
I also just tried this that also had the same effect: and a component @RenderTest: foo This the thing I don't understand: in this post http://www.behindthesite.com/blog/C1931765677/E923478269/index.html he does essentially the same thing. But I don't seem to be able to do recursion at all because the first time I call @RenderBlock it caches the parameter value, no matter if it's in the same template or if it's in another component all together. At this point I'm thoroughly confused at how to do this. I mean, there has *got* to be a way to do what I want to do right? I love tapestry and I don't mean to rant or complain, but why is doing recursion so difficult? Will this be changed in T4.1 or T5? If I'm just being stupid and not seeing something, please will someone point it out. :) On Thu, 2006-08-03 at 10:47 -0400, Dan Adams wrote: > Nope, no difference. I also tried changing it to this with no effect: > > > foo >name="ognl:getBlock()" /> > > > >block="ognl:components.testrenderer.getParameter('name')" /> > > > I know that the informal parameters are not cached so I thought I'd try > it. but then the block parameter for the second @RenderBlock is still > cached so it has the same effect. > > I thought that there also might be a way of temporarily disabling > parameter caching with a component or something. So I checked the > tapestry class enhancement code for parameters. It creates a property > that stores whether or not each parameter is cached each time the > parameter is accessed and there doesn't seem to be a way for me to > access those as they are private properties created in the enhanced > class. > > On Thu, 2006-08-03 at 20:08 +0530, Karthik N wrote: > > very interesting problem. > > > > just a wild thought after looking at your configuration - what if you change > > "ognl:getBlock()" to "ognl:block" - does that make a difference ?? > > > > On 8/3/06, Dan Adams <[EMAIL PROTECTED]> wrote: > > > > > > Okay, here's a test case. I have this is in the template: > > > > > > > > > > > > > > > foo > > > > > > > > > > > > bar > > > > > > and this in the class: > > > > > > public abstract int getIndex(); > > > public abstract void setIndex(int i); > > > > > > public String[] getBlocks() { > > > return new String[] { "test", "block1" }; > > > } > > > > > > public Object getBlock() { > > > int i = getIndex(); > > > setIndex(i + 1); > > > return getComponent( getBlocks()[i] ); > > > } > > > > > > Now, this *should* under my understanding (I think there is something I > > > missing about how tapestry renders and evaluates whether parameters have > > > been cached) print out "foo bar". But instead it continuously prints out > > > "foo". If you set a breakpoint in getBlock() it is only called once. > > > What am I missing here? > > > > > > It seems that because the second renderblock is in the template that the > > > next time that block is rendered, tapestry considers the parameter > > > cached and doesn't re-evaluate it. And I don't know of a way to tell > > > tapestry not to cache it because obviously I can't change the @Block > > > component specification. Any ideas? > > > > > > On Thu, 2006-08-03 at 19:17 +0530, Karthik N wrote: > > > > i've faced a similar problem before try and set cache="false" for your > > > > parameters. > > > > > > > > On 8/3/06, Dan Adams <[EMAIL PROTECTED]> wrote: > > > > > > > > > > I actually already created an @Eval component that does just that. The > > > > > problem is that the expression that returns the block to render to > > > > > @RenderBlock is only evaluated the first time. > > > > > > > > > > On Wed, 2006-08-02 at 18:19 -0700, Epstein, Ezra wrote: > > > > > > This may not be the issue, but... > > > > > > > > > > > > You could make a "dyna-eval" component that (re-)evaluates an ognl > > > > > expression wherever/whenever you choose. > > > > > > > > > > > > OGNL is pretty easy
Re: recursive rendering
Nope, no difference. I also tried changing it to this with no effect: foo I know that the informal parameters are not cached so I thought I'd try it. but then the block parameter for the second @RenderBlock is still cached so it has the same effect. I thought that there also might be a way of temporarily disabling parameter caching with a component or something. So I checked the tapestry class enhancement code for parameters. It creates a property that stores whether or not each parameter is cached each time the parameter is accessed and there doesn't seem to be a way for me to access those as they are private properties created in the enhanced class. On Thu, 2006-08-03 at 20:08 +0530, Karthik N wrote: > very interesting problem. > > just a wild thought after looking at your configuration - what if you change > "ognl:getBlock()" to "ognl:block" - does that make a difference ?? > > On 8/3/06, Dan Adams <[EMAIL PROTECTED]> wrote: > > > > Okay, here's a test case. I have this is in the template: > > > > > > > > > > foo > > > > > > > > bar > > > > and this in the class: > > > > public abstract int getIndex(); > > public abstract void setIndex(int i); > > > > public String[] getBlocks() { > > return new String[] { "test", "block1" }; > > } > > > > public Object getBlock() { > > int i = getIndex(); > > setIndex(i + 1); > > return getComponent( getBlocks()[i] ); > > } > > > > Now, this *should* under my understanding (I think there is something I > > missing about how tapestry renders and evaluates whether parameters have > > been cached) print out "foo bar". But instead it continuously prints out > > "foo". If you set a breakpoint in getBlock() it is only called once. > > What am I missing here? > > > > It seems that because the second renderblock is in the template that the > > next time that block is rendered, tapestry considers the parameter > > cached and doesn't re-evaluate it. And I don't know of a way to tell > > tapestry not to cache it because obviously I can't change the @Block > > component specification. Any ideas? > > > > On Thu, 2006-08-03 at 19:17 +0530, Karthik N wrote: > > > i've faced a similar problem before try and set cache="false" for your > > > parameters. > > > > > > On 8/3/06, Dan Adams <[EMAIL PROTECTED]> wrote: > > > > > > > > I actually already created an @Eval component that does just that. The > > > > problem is that the expression that returns the block to render to > > > > @RenderBlock is only evaluated the first time. > > > > > > > > On Wed, 2006-08-02 at 18:19 -0700, Epstein, Ezra wrote: > > > > > This may not be the issue, but... > > > > > > > > > > You could make a "dyna-eval" component that (re-)evaluates an ognl > > > > expression wherever/whenever you choose. > > > > > > > > > > OGNL is pretty easy to work with. > > > > > > > > > > Perhaps that could work? > > > > > > > > > > Thanks, > > > > > > > > > > Ezra Epstein > > > > > > > > > > -Original Message- > > > > > From: Dan Adams [mailto:[EMAIL PROTECTED] > > > > > Sent: Wednesday, August 02, 2006 2:31 PM > > > > > To: Tapestry users > > > > > Subject: Re: recursive rendering > > > > > > > > > > Thanks Mike. Yeah, I've read that article at least twice now and > > read > > > > through the code. :) I'm having a problem that you may have run into; > > much > > > > like your code the block to render is returned via an ognl expression > > and it > > > > apprears the the expression is only being evaluated once and not each > > time. > > > > Did you ever have this problem? > > > > > > > > > > On Tue, 2006-08-01 at 16:04 -0700, Mike Henderson wrote: > > > > > > Hi, > > > > > > It's a T3 example but it should show how it's done: > > > > > > > > > > > > > > http://www.behindthesite.com/blog/C1931765677/E923478269/index.html > > > > > > > > > > > >
Re: recursive rendering
very interesting problem. just a wild thought after looking at your configuration - what if you change "ognl:getBlock()" to "ognl:block" - does that make a difference ?? On 8/3/06, Dan Adams <[EMAIL PROTECTED]> wrote: Okay, here's a test case. I have this is in the template: foo bar and this in the class: public abstract int getIndex(); public abstract void setIndex(int i); public String[] getBlocks() { return new String[] { "test", "block1" }; } public Object getBlock() { int i = getIndex(); setIndex(i + 1); return getComponent( getBlocks()[i] ); } Now, this *should* under my understanding (I think there is something I missing about how tapestry renders and evaluates whether parameters have been cached) print out "foo bar". But instead it continuously prints out "foo". If you set a breakpoint in getBlock() it is only called once. What am I missing here? It seems that because the second renderblock is in the template that the next time that block is rendered, tapestry considers the parameter cached and doesn't re-evaluate it. And I don't know of a way to tell tapestry not to cache it because obviously I can't change the @Block component specification. Any ideas? On Thu, 2006-08-03 at 19:17 +0530, Karthik N wrote: > i've faced a similar problem before try and set cache="false" for your > parameters. > > On 8/3/06, Dan Adams <[EMAIL PROTECTED]> wrote: > > > > I actually already created an @Eval component that does just that. The > > problem is that the expression that returns the block to render to > > @RenderBlock is only evaluated the first time. > > > > On Wed, 2006-08-02 at 18:19 -0700, Epstein, Ezra wrote: > > > This may not be the issue, but... > > > > > > You could make a "dyna-eval" component that (re-)evaluates an ognl > > expression wherever/whenever you choose. > > > > > > OGNL is pretty easy to work with. > > > > > > Perhaps that could work? > > > > > > Thanks, > > > > > > Ezra Epstein > > > > > > -Original Message- > > > From: Dan Adams [mailto:[EMAIL PROTECTED] > > > Sent: Wednesday, August 02, 2006 2:31 PM > > > To: Tapestry users > > > Subject: Re: recursive rendering > > > > > > Thanks Mike. Yeah, I've read that article at least twice now and read > > through the code. :) I'm having a problem that you may have run into; much > > like your code the block to render is returned via an ognl expression and it > > apprears the the expression is only being evaluated once and not each time. > > Did you ever have this problem? > > > > > > On Tue, 2006-08-01 at 16:04 -0700, Mike Henderson wrote: > > > > Hi, > > > > It's a T3 example but it should show how it's done: > > > > > > > > http://www.behindthesite.com/blog/C1931765677/E923478269/index.html > > > > > > > > Mike > > > > > > > > > > > > - > > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > -- > > > Dan Adams > > > Senior Software Engineer > > > Interactive Factory > > > 617.235.5857 > > > > > > > > > - > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > - > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > -- > > Dan Adams > > Senior Software Engineer > > Interactive Factory > > 617.235.5857 > > > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > -- Dan Adams Senior Software Engineer Interactive Factory 617.235.5857 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Thanks, Karthik
Re: recursive rendering
Okay, here's a test case. I have this is in the template: foo bar and this in the class: public abstract int getIndex(); public abstract void setIndex(int i); public String[] getBlocks() { return new String[] { "test", "block1" }; } public Object getBlock() { int i = getIndex(); setIndex(i + 1); return getComponent( getBlocks()[i] ); } Now, this *should* under my understanding (I think there is something I missing about how tapestry renders and evaluates whether parameters have been cached) print out "foo bar". But instead it continuously prints out "foo". If you set a breakpoint in getBlock() it is only called once. What am I missing here? It seems that because the second renderblock is in the template that the next time that block is rendered, tapestry considers the parameter cached and doesn't re-evaluate it. And I don't know of a way to tell tapestry not to cache it because obviously I can't change the @Block component specification. Any ideas? On Thu, 2006-08-03 at 19:17 +0530, Karthik N wrote: > i've faced a similar problem before try and set cache="false" for your > parameters. > > On 8/3/06, Dan Adams <[EMAIL PROTECTED]> wrote: > > > > I actually already created an @Eval component that does just that. The > > problem is that the expression that returns the block to render to > > @RenderBlock is only evaluated the first time. > > > > On Wed, 2006-08-02 at 18:19 -0700, Epstein, Ezra wrote: > > > This may not be the issue, but... > > > > > > You could make a "dyna-eval" component that (re-)evaluates an ognl > > expression wherever/whenever you choose. > > > > > > OGNL is pretty easy to work with. > > > > > > Perhaps that could work? > > > > > > Thanks, > > > > > > Ezra Epstein > > > > > > -Original Message- > > > From: Dan Adams [mailto:[EMAIL PROTECTED] > > > Sent: Wednesday, August 02, 2006 2:31 PM > > > To: Tapestry users > > > Subject: Re: recursive rendering > > > > > > Thanks Mike. Yeah, I've read that article at least twice now and read > > through the code. :) I'm having a problem that you may have run into; much > > like your code the block to render is returned via an ognl expression and it > > apprears the the expression is only being evaluated once and not each time. > > Did you ever have this problem? > > > > > > On Tue, 2006-08-01 at 16:04 -0700, Mike Henderson wrote: > > > > Hi, > > > > It's a T3 example but it should show how it's done: > > > > > > > > http://www.behindthesite.com/blog/C1931765677/E923478269/index.html > > > > > > > > Mike > > > > > > > > > > > > - > > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > -- > > > Dan Adams > > > Senior Software Engineer > > > Interactive Factory > > > 617.235.5857 > > > > > > > > > - > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > - > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > -- > > Dan Adams > > Senior Software Engineer > > Interactive Factory > > 617.235.5857 > > > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > -- Dan Adams Senior Software Engineer Interactive Factory 617.235.5857 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: recursive rendering
If it is a parameter then disable caching by setting the "cache" attribute of the parameter to false/no. Regards, Norbi Dan Adams wrote: I actually already created an @Eval component that does just that. The problem is that the expression that returns the block to render to @RenderBlock is only evaluated the first time. On Wed, 2006-08-02 at 18:19 -0700, Epstein, Ezra wrote: This may not be the issue, but... You could make a "dyna-eval" component that (re-)evaluates an ognl expression wherever/whenever you choose. OGNL is pretty easy to work with. Perhaps that could work? Thanks, Ezra Epstein -Original Message- From: Dan Adams [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 02, 2006 2:31 PM To: Tapestry users Subject: Re: recursive rendering Thanks Mike. Yeah, I've read that article at least twice now and read through the code. :) I'm having a problem that you may have run into; much like your code the block to render is returned via an ognl expression and it apprears the the expression is only being evaluated once and not each time. Did you ever have this problem? On Tue, 2006-08-01 at 16:04 -0700, Mike Henderson wrote: Hi, It's a T3 example but it should show how it's done: http://www.behindthesite.com/blog/C1931765677/E923478269/index.html Mike - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Dan Adams Senior Software Engineer Interactive Factory 617.235.5857 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: recursive rendering
i've faced a similar problem before try and set cache="false" for your parameters. On 8/3/06, Dan Adams <[EMAIL PROTECTED]> wrote: I actually already created an @Eval component that does just that. The problem is that the expression that returns the block to render to @RenderBlock is only evaluated the first time. On Wed, 2006-08-02 at 18:19 -0700, Epstein, Ezra wrote: > This may not be the issue, but... > > You could make a "dyna-eval" component that (re-)evaluates an ognl expression wherever/whenever you choose. > > OGNL is pretty easy to work with. > > Perhaps that could work? > > Thanks, > > Ezra Epstein > > -Original Message- > From: Dan Adams [mailto:[EMAIL PROTECTED] > Sent: Wednesday, August 02, 2006 2:31 PM > To: Tapestry users > Subject: Re: recursive rendering > > Thanks Mike. Yeah, I've read that article at least twice now and read through the code. :) I'm having a problem that you may have run into; much like your code the block to render is returned via an ognl expression and it apprears the the expression is only being evaluated once and not each time. Did you ever have this problem? > > On Tue, 2006-08-01 at 16:04 -0700, Mike Henderson wrote: > > Hi, > > It's a T3 example but it should show how it's done: > > > > http://www.behindthesite.com/blog/C1931765677/E923478269/index.html > > > > Mike > > > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- > Dan Adams > Senior Software Engineer > Interactive Factory > 617.235.5857 > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > -- Dan Adams Senior Software Engineer Interactive Factory 617.235.5857 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Thanks, Karthik
RE: recursive rendering
I actually already created an @Eval component that does just that. The problem is that the expression that returns the block to render to @RenderBlock is only evaluated the first time. On Wed, 2006-08-02 at 18:19 -0700, Epstein, Ezra wrote: > This may not be the issue, but... > > You could make a "dyna-eval" component that (re-)evaluates an ognl expression > wherever/whenever you choose. > > OGNL is pretty easy to work with. > > Perhaps that could work? > > Thanks, > > Ezra Epstein > > -Original Message- > From: Dan Adams [mailto:[EMAIL PROTECTED] > Sent: Wednesday, August 02, 2006 2:31 PM > To: Tapestry users > Subject: Re: recursive rendering > > Thanks Mike. Yeah, I've read that article at least twice now and read through > the code. :) I'm having a problem that you may have run into; much like your > code the block to render is returned via an ognl expression and it apprears > the the expression is only being evaluated once and not each time. Did you > ever have this problem? > > On Tue, 2006-08-01 at 16:04 -0700, Mike Henderson wrote: > > Hi, > > It's a T3 example but it should show how it's done: > > > > http://www.behindthesite.com/blog/C1931765677/E923478269/index.html > > > > Mike > > > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- > Dan Adams > Senior Software Engineer > Interactive Factory > 617.235.5857 > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > -- Dan Adams Senior Software Engineer Interactive Factory 617.235.5857 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: recursive rendering
Dan Adams wrote: > Thanks Bernard. Your template seems really straight forward. No problem :) > The problem I having right now is that the block that is rendered is returned > via an > ognl expression and the expression is only being evaluated once. Do you > know a way around this? I'm not sure if I got it right, are we talking about this particular part of the template? ^^^? When Foreach is rendered the ognl expression in is evaluated every time the RenderBlock gets rendered :) You can replace it with a call to Java method and there return different blocks of your choice. I'm not sure if I understand what the problem really is. So you want recursion or not :-) or you want block to change from time to time or you neeed both? Can you tell me what excactly are you trying to achieve and I may be able to help? Regards, Bernard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: recursive rendering
This may not be the issue, but... You could make a "dyna-eval" component that (re-)evaluates an ognl expression wherever/whenever you choose. OGNL is pretty easy to work with. Perhaps that could work? Thanks, Ezra Epstein -Original Message- From: Dan Adams [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 02, 2006 2:31 PM To: Tapestry users Subject: Re: recursive rendering Thanks Mike. Yeah, I've read that article at least twice now and read through the code. :) I'm having a problem that you may have run into; much like your code the block to render is returned via an ognl expression and it apprears the the expression is only being evaluated once and not each time. Did you ever have this problem? On Tue, 2006-08-01 at 16:04 -0700, Mike Henderson wrote: > Hi, > It's a T3 example but it should show how it's done: > > http://www.behindthesite.com/blog/C1931765677/E923478269/index.html > > Mike > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > -- Dan Adams Senior Software Engineer Interactive Factory 617.235.5857 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: recursive rendering
Thanks Mike. Yeah, I've read that article at least twice now and read through the code. :) I'm having a problem that you may have run into; much like your code the block to render is returned via an ognl expression and it apprears the the expression is only being evaluated once and not each time. Did you ever have this problem? On Tue, 2006-08-01 at 16:04 -0700, Mike Henderson wrote: > Hi, > It's a T3 example but it should show how it's done: > > http://www.behindthesite.com/blog/C1931765677/E923478269/index.html > > Mike > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > -- Dan Adams Senior Software Engineer Interactive Factory 617.235.5857 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: recursive rendering
Thanks Bernard. Your template seems really straight forward. The problem I having right now is that the block that is rendered is returned via an ognl expression and the expression is only being evaluated once. Do you know a way around this? On Wed, 2006-08-02 at 15:49 +0200, Bernard Lange wrote: > Dan Adams wrote: > > Every once in a while I'll need to do some recursive rendering. Does > > anyone know of a simple example of this using @Block? > > We do it that way. This renders tree-like, no folding though, recursive > structure of report groups containing other report groups (which are > compound nodes) and reports (leafs). Root group is given as a parameter, > but it may be as well page property with initial value set to sth. You > also need some exit condition, which in this case is size of > reportGroups property. > > Note that the group property is updated in the second loop so that the > recursive call to "groupBlock" could render its children properly. > > Some styling has been removed for a sake of readability: > > ** > > > > > > > > value="ognl:report" element="ul"> > > > > > >condition="ognl:group.reportGroups.size() > 0"> > value="ognl:group" > > > > > > > > > ** > allow-body="no" allow-informal-parameters="no"> > >required="yes" > direction="auto" > /> > > > > > > > best regards, > Bernard > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > -- Dan Adams Senior Software Engineer Interactive Factory 617.235.5857 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: recursive rendering
Dan Adams wrote: > Every once in a while I'll need to do some recursive rendering. Does > anyone know of a simple example of this using @Block? We do it that way. This renders tree-like, no folding though, recursive structure of report groups containing other report groups (which are compound nodes) and reports (leafs). Root group is given as a parameter, but it may be as well page property with initial value set to sth. You also need some exit condition, which in this case is size of reportGroups property. Note that the group property is updated in the second loop so that the recursive call to "groupBlock" could render its children properly. Some styling has been removed for a sake of readability: ** ** best regards, Bernard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: recursive rendering
Hi, It's a T3 example but it should show how it's done: http://www.behindthesite.com/blog/C1931765677/E923478269/index.html Mike - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]