Re: Showing a Block condirionally
Its what Lance said about JSTL and tapestry making use of a similar component and then he add tags similar to tapestry's (ex: t:choose). I guess he was only suggesting and giving and example. Thanks. On Thu, Nov 15, 2012 at 1:16 AM, Lenny Primak wrote: > Serge didn't mention anything about JSTL. This is pure tapestry 5 case > switching. > > On Nov 14, 2012, at 6:09 PM, Muhammad Gelbana wrote: > > > Is this still tapestry5 ? I couldn't find how t5 can use JSTL ! > > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > >
Re: Showing a Block condirionally
Serge didn't mention anything about JSTL. This is pure tapestry 5 case switching. On Nov 14, 2012, at 6:09 PM, Muhammad Gelbana wrote: > Is this still tapestry5 ? I couldn't find how t5 can use JSTL ! - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Showing a Block condirionally
Is this still tapestry5 ? I couldn't find how t5 can use JSTL ! On Wed, Nov 14, 2012 at 5:13 PM, Serge Eby wrote: > There is a simple example already here: > > http://tapestry.apache.org/switching-cases.html > > > /Serge > > > > -- > View this message in context: > http://tapestry-users.832.n2.nabble.com/Showing-a-Block-condirionally-tp7583424p7583436.html > Sent from the Tapestry Users mailing list archive at Nabble.com. > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > >
Re: Showing a Block condirionally
There is a simple example already here: http://tapestry.apache.org/switching-cases.html /Serge -- View this message in context: http://tapestry-users.832.n2.nabble.com/Showing-a-Block-condirionally-tp7583424p7583436.html Sent from the Tapestry Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Showing a Block condirionally
Great point, worthy of consideration. "Choose" has an advantage over sequential If components: only one of the tests will succeed, whereas with sequential Ifs the value being tested can change before the next If. And "Choose" has an advantage over the "else" parameter block, being that it is much easier to read. On 14/11/2012, at 3:33 AM, Lance Java wrote: > In JSTL, there is a "choose" tag [1] which I think is a more elegant way of > handling the else condition. Perhaps tapestry could benefit from a similar > component? > > > Foo > Bar > Baz > > > [1] http://www.tutorialspoint.com/jsp/jstl_core_choose_tag.htm > > > > -- > View this message in context: > http://tapestry.1045711.n5.nabble.com/Showing-a-Block-condirionally-tp5717967p5717985.html > Sent from the Tapestry - User mailing list archive at Nabble.com. > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Showing a Block condirionally
On Tue, 13 Nov 2012 14:33:29 -0200, Lance Java wrote: In JSTL, there is a "choose" tag [1] which I think is a more elegant way of handling the else condition. Perhaps tapestry could benefit from a similar component? Foo Bar Baz I still prefer to use blocks, the Delegate component and logic in Java classes. :) -- Thiago H. de Paula Figueiredo - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Showing a Block condirionally
In JSTL, there is a "choose" tag [1] which I think is a more elegant way of handling the else condition. Perhaps tapestry could benefit from a similar component? Foo Bar Baz [1] http://www.tutorialspoint.com/jsp/jstl_core_choose_tag.htm -- View this message in context: http://tapestry.1045711.n5.nabble.com/Showing-a-Block-condirionally-tp5717967p5717985.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Showing a Block condirionally
+1 On 13/11/2012, at 10:03 PM, Thiago H de Paula Figueiredo wrote: > On Tue, 13 Nov 2012 08:18:40 -0200, mateen wrote: > >> Hi, > > Hi! > >> >> I have a Border component that has the following code >> div id="right"> >> >> >> >> >> >> > > Guys, please, this form of if-else is very, very confusing to read. Why don't > we all use this instead: > > > > > > something else > > > -- > Thiago H. de Paula Figueiredo > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Showing a Block condirionally
The "Delegate" component uses "prop:" binding prefix by default so a method withing your page\component will have to make that decision for you. But if you need to decide from withing the tamplate, you can use the "block:" binding prefix. http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/Delegate.html http://tapestry.apache.org/component-parameters.html#ComponentParameters-UsingBindingExpressions On Tue, Nov 13, 2012 at 12:29 PM, nquirynen wrote: > I think you just need to pass a parameter to your component that defines > wheter to show that part yes or not. > > So in your component: > > @Parameter > @Property > private boolean showRight; > > in .tml: > > > > > > > > > > > > -- > View this message in context: > http://tapestry.1045711.n5.nabble.com/Showing-a-Block-condirionally-tp5717967p5717968.html > Sent from the Tapestry - User mailing list archive at Nabble.com. > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > >
Re: Showing a Block condirionally
On Tue, 13 Nov 2012 08:18:40 -0200, mateen wrote: Hi, Hi! I have a Border component that has the following code div id="right"> Guys, please, this form of if-else is very, very confusing to read. Why don't we all use this instead: something else -- Thiago H. de Paula Figueiredo - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Showing a Block condirionally
I think you just need to pass a parameter to your component that defines wheter to show that part yes or not. So in your component: @Parameter @Property private boolean showRight; in .tml: -- View this message in context: http://tapestry.1045711.n5.nabble.com/Showing-a-Block-condirionally-tp5717967p5717968.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org