Re: Zone and content changment
Generic question requires a generic answer :) Start from here http://tapestry.apache.org/ajax-and-zones.html On Fri, May 17, 2013 at 9:49 PM, Nomen Nomanum getibi...@outlook.comwrote: I want to implement a scenario where based on clicked actionlink, zone updates it's content. Lets say I have stored some divs inside that zone, and I need trigger, videlicit, checker to see what div to render. How to achieve this behavior? -- Sincerely *Boris Horvat*
RE: Zone and content changment
Hmm... well, what troubles me is this scenario: Suppose in my tml I have t:zone div class=1/div div class=2/div /t:zone Now, based on clicked actionlink1, I want to render only div1, and not div2. How to achieve this not including delegates and blocks? Is there any other way? From: horvat.z.bo...@gmail.com Date: Fri, 17 May 2013 21:58:32 +0200 Subject: Re: Zone and content changment To: users@tapestry.apache.org Generic question requires a generic answer :) Start from here http://tapestry.apache.org/ajax-and-zones.html On Fri, May 17, 2013 at 9:49 PM, Nomen Nomanum getibi...@outlook.comwrote: I want to implement a scenario where based on clicked actionlink, zone updates it's content. Lets say I have stored some divs inside that zone, and I need trigger, videlicit, checker to see what div to render. How to achieve this behavior? -- Sincerely *Boris Horvat*
Re: Zone and content changment
And why dont you want to use delegates and blocks? That is what they are there for...You could use t:if On Fri, May 17, 2013 at 10:33 PM, Nomen Nomanum getibi...@outlook.comwrote: Hmm... well, what troubles me is this scenario: Suppose in my tml I have t:zone div class=1/div div class=2/div /t:zone Now, based on clicked actionlink1, I want to render only div1, and not div2. How to achieve this not including delegates and blocks? Is there any other way? From: horvat.z.bo...@gmail.com Date: Fri, 17 May 2013 21:58:32 +0200 Subject: Re: Zone and content changment To: users@tapestry.apache.org Generic question requires a generic answer :) Start from here http://tapestry.apache.org/ajax-and-zones.html On Fri, May 17, 2013 at 9:49 PM, Nomen Nomanum getibi...@outlook.com wrote: I want to implement a scenario where based on clicked actionlink, zone updates it's content. Lets say I have stored some divs inside that zone, and I need trigger, videlicit, checker to see what div to render. How to achieve this behavior? -- Sincerely *Boris Horvat* -- Sincerely *Boris Horvat*
RE: Zone and content changment
Great! That's the answer I have been waiting for. But how my t:if could know what actionlink is clicked? Lets say I have following scenario: t:zone t:id=Zone // my zone t:if test= // how to test what actionlink is clicked t:delegate to=block1 / // get me to modelBlock1 block /t:if t:if test= // how to test what actionlink is clickedt:delegate to=block2 / // get me to modelBlock2 block /t:if t:block id=block1 p block1/p /t:block t:block id=block2 p block2/p /t:block /t:zone From: horvat.z.bo...@gmail.com Date: Fri, 17 May 2013 22:35:26 +0200 Subject: Re: Zone and content changment To: users@tapestry.apache.org And why dont you want to use delegates and blocks? That is what they are there for...You could use t:if On Fri, May 17, 2013 at 10:33 PM, Nomen Nomanum getibi...@outlook.comwrote: Hmm... well, what troubles me is this scenario: Suppose in my tml I have t:zone div class=1/div div class=2/div /t:zone Now, based on clicked actionlink1, I want to render only div1, and not div2. How to achieve this not including delegates and blocks? Is there any other way? From: horvat.z.bo...@gmail.com Date: Fri, 17 May 2013 21:58:32 +0200 Subject: Re: Zone and content changment To: users@tapestry.apache.org Generic question requires a generic answer :) Start from here http://tapestry.apache.org/ajax-and-zones.html On Fri, May 17, 2013 at 9:49 PM, Nomen Nomanum getibi...@outlook.com wrote: I want to implement a scenario where based on clicked actionlink, zone updates it's content. Lets say I have stored some divs inside that zone, and I need trigger, videlicit, checker to see what div to render. How to achieve this behavior? -- Sincerely *Boris Horvat* -- Sincerely *Boris Horvat*
Re: Zone and content changment
I am not sure what you really wont. Here you have 2 choice. First you can use t:if and I dont recommend this one. The ideas that for every actionlink clicked you set some boolean value to true and in the t:if you check which one is set to true and then display that part of the html. The second choice is to use delegates and blocks http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/Delegate.html I usually keep an enum field and then return the appropriate block given that value. Cheers On Fri, May 17, 2013 at 10:58 PM, Nomen Nomanum getibi...@outlook.comwrote: Great! That's the answer I have been waiting for. But how my t:if could know what actionlink is clicked? Lets say I have following scenario: t:zone t:id=Zone // my zone t:if test= // how to test what actionlink is clicked t:delegate to=block1 / // get me to modelBlock1 block /t:if t:if test= // how to test what actionlink is clickedt:delegate to=block2 / // get me to modelBlock2 block /t:if t:block id=block1 p block1/p /t:block t:block id=block2 p block2/p /t:block /t:zone From: horvat.z.bo...@gmail.com Date: Fri, 17 May 2013 22:35:26 +0200 Subject: Re: Zone and content changment To: users@tapestry.apache.org And why dont you want to use delegates and blocks? That is what they are there for...You could use t:if On Fri, May 17, 2013 at 10:33 PM, Nomen Nomanum getibi...@outlook.com wrote: Hmm... well, what troubles me is this scenario: Suppose in my tml I have t:zone div class=1/div div class=2/div /t:zone Now, based on clicked actionlink1, I want to render only div1, and not div2. How to achieve this not including delegates and blocks? Is there any other way? From: horvat.z.bo...@gmail.com Date: Fri, 17 May 2013 21:58:32 +0200 Subject: Re: Zone and content changment To: users@tapestry.apache.org Generic question requires a generic answer :) Start from here http://tapestry.apache.org/ajax-and-zones.html On Fri, May 17, 2013 at 9:49 PM, Nomen Nomanum getibi...@outlook.com wrote: I want to implement a scenario where based on clicked actionlink, zone updates it's content. Lets say I have stored some divs inside that zone, and I need trigger, videlicit, checker to see what div to render. How to achieve this behavior? -- Sincerely *Boris Horvat* -- Sincerely *Boris Horvat* -- Sincerely *Boris Horvat*
RE: Zone and content changment
Thanks! I have implemented this. :) From: horvat.z.bo...@gmail.com Date: Fri, 17 May 2013 23:05:38 +0200 Subject: Re: Zone and content changment To: users@tapestry.apache.org I am not sure what you really wont. Here you have 2 choice. First you can use t:if and I dont recommend this one. The ideas that for every actionlink clicked you set some boolean value to true and in the t:if you check which one is set to true and then display that part of the html. The second choice is to use delegates and blocks http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/Delegate.html I usually keep an enum field and then return the appropriate block given that value. Cheers On Fri, May 17, 2013 at 10:58 PM, Nomen Nomanum getibi...@outlook.comwrote: Great! That's the answer I have been waiting for. But how my t:if could know what actionlink is clicked? Lets say I have following scenario: t:zone t:id=Zone // my zone t:if test= // how to test what actionlink is clicked t:delegate to=block1 / // get me to modelBlock1 block /t:if t:if test= // how to test what actionlink is clickedt:delegate to=block2 / // get me to modelBlock2 block /t:if t:block id=block1 p block1/p /t:block t:block id=block2 p block2/p /t:block /t:zone From: horvat.z.bo...@gmail.com Date: Fri, 17 May 2013 22:35:26 +0200 Subject: Re: Zone and content changment To: users@tapestry.apache.org And why dont you want to use delegates and blocks? That is what they are there for...You could use t:if On Fri, May 17, 2013 at 10:33 PM, Nomen Nomanum getibi...@outlook.com wrote: Hmm... well, what troubles me is this scenario: Suppose in my tml I have t:zone div class=1/div div class=2/div /t:zone Now, based on clicked actionlink1, I want to render only div1, and not div2. How to achieve this not including delegates and blocks? Is there any other way? From: horvat.z.bo...@gmail.com Date: Fri, 17 May 2013 21:58:32 +0200 Subject: Re: Zone and content changment To: users@tapestry.apache.org Generic question requires a generic answer :) Start from here http://tapestry.apache.org/ajax-and-zones.html On Fri, May 17, 2013 at 9:49 PM, Nomen Nomanum getibi...@outlook.com wrote: I want to implement a scenario where based on clicked actionlink, zone updates it's content. Lets say I have stored some divs inside that zone, and I need trigger, videlicit, checker to see what div to render. How to achieve this behavior? -- Sincerely *Boris Horvat* -- Sincerely *Boris Horvat* -- Sincerely *Boris Horvat*