You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Gnu Ubuntu <gn...@gmail.com> on 2011/01/23 17:18:52 UTC
Dynamic Layout
Hi,
I need to apply an if condition in the <title> in a layout component.
In my layout I want to do :
<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd">
<head>
<t:if test="condition">Error in </t:if><title>Page title</title>
</head>
<body>...........
So I can get the information that current page is in error
(information stored in session),
but I seem that Tapestry don't reload Layout. So even if my page is in
error my IF is not verifiyed.
How can I tell Tapestry to reload layout page ?
thanks in advance.
Re: Dynamic Layout
Posted by Josh Canfield <jo...@gmail.com>.
You haven't shown us the code that you use to call the template, but you are
probably using parameter="${prop}" which converts your prop to a string
binding which is considered constant and so its not re-evaluated.
you should use "prop:propname".
Just a guess.
Josh.
On Jan 23, 2011 8:19 AM, "Gnu Ubuntu" <gn...@gmail.com> wrote:
>
> Hi,
> I need to apply an if condition in the <title> in a layout component.
> In my layout I want to do :
>
> <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd">
> <head>
> <t:if test="condition">Error in </t:if><title>Page title</title>
> </head>
> <body>...........
>
> So I can get the information that current page is in error
> (information stored in session),
> but I seem that Tapestry don't reload Layout. So even if my page is in
> error my IF is not verifiyed.
>
> How can I tell Tapestry to reload layout page ?
>
> thanks in advance.
Re: Dynamic Layout
Posted by Gnu Ubuntu <gn...@gmail.com>.
Thanks for your responses.
I can't paste code here, but I works for other use's cases. My method tell
me if my form in current page is on error. And in this case I need to add
the word "Error" in title of this page.
I hope it's more clear now.
So the second why proposed by Taha is not useful in this case.
Thanks,
Re: Dynamic Layout
Posted by Taha Hafeez <ta...@gmail.com>.
Why not do this tapestry way!!
extend RequestExceptionHandler<file:///home/taha/java/tapestry_docs/org/apache/tapestry5/services/RequestExceptionHandler.html>
see http://tapestry.apache.org/overriding-exception-reporting.html
<http://tapestry.apache.org/overriding-exception-reporting.html>regards
Taha
On Sun, Jan 23, 2011 at 10:00 PM, Joost Schouten (mailing lists) <
joost_ml@jsportal.com> wrote:
> Hi,
>
> What does "page is in error" mean? Actual Exception on your page? Form
> validation problem? And please post the code of your condition
> (isCondition()) as that will most likely be the problem. Or if you are
> using a zone (AJAX) your layout will not be reloded either. On a
> normal page request your code should work so the problem lies
> somewhere else.
>
> Cheers,
> Joost
>
> On Sun, Jan 23, 2011 at 5:18 PM, Gnu Ubuntu <gn...@gmail.com> wrote:
> > Hi,
> > I need to apply an if condition in the <title> in a layout component.
> > In my layout I want to do :
> >
> > <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd">
> > <head>
> > <t:if test="condition">Error in </t:if><title>Page title</title>
> > </head>
> > <body>...........
> >
> > So I can get the information that current page is in error
> > (information stored in session),
> > but I seem that Tapestry don't reload Layout. So even if my page is in
> > error my IF is not verifiyed.
> >
> > How can I tell Tapestry to reload layout page ?
> >
> > thanks in advance.
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
Re: Dynamic Layout
Posted by "Joost Schouten (mailing lists)" <jo...@jsportal.com>.
Hi,
What does "page is in error" mean? Actual Exception on your page? Form
validation problem? And please post the code of your condition
(isCondition()) as that will most likely be the problem. Or if you are
using a zone (AJAX) your layout will not be reloded either. On a
normal page request your code should work so the problem lies
somewhere else.
Cheers,
Joost
On Sun, Jan 23, 2011 at 5:18 PM, Gnu Ubuntu <gn...@gmail.com> wrote:
> Hi,
> I need to apply an if condition in the <title> in a layout component.
> In my layout I want to do :
>
> <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd">
> <head>
> <t:if test="condition">Error in </t:if><title>Page title</title>
> </head>
> <body>...........
>
> So I can get the information that current page is in error
> (information stored in session),
> but I seem that Tapestry don't reload Layout. So even if my page is in
> error my IF is not verifiyed.
>
> How can I tell Tapestry to reload layout page ?
>
> thanks in advance.
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Dynamic Layout
Posted by Mark <ma...@xeric.net>.
Shouldn't the IF be within the title tags?
<head>
<title><t:if test="condition">Error in </t:if>Page title</title>
</head>
Otherwise the browser isn't going to know where to put it and may just
discard anything that does render there.
Mark
On Sun, Jan 23, 2011 at 10:18 AM, Gnu Ubuntu <gn...@gmail.com> wrote:
> Hi,
> I need to apply an if condition in the <title> in a layout component.
> In my layout I want to do :
>
> <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd">
> <head>
> <t:if test="condition">Error in </t:if><title>Page title</title>
> </head>
> <body>...........
>
> So I can get the information that current page is in error
> (information stored in session),
> but I seem that Tapestry don't reload Layout. So even if my page is in
> error my IF is not verifiyed.
>
> How can I tell Tapestry to reload layout page ?
>
> thanks in advance.
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Dynamic Layout
Posted by LLTYK <LL...@mailinator.com>.
You need to do it in Javascript (document.title = "Blah" + document.title).
Or if you disable Tapestry javascript validation the layout will be
rerendered as you expect.
Tapestry doesn't seem to have a good place to hook into failed javascript
validations though. As far as I can tell you'd hook into the submit event on
the form and check $T(theform).validationError. So:
$('id_of_the_form').observe('submit', function() {
if ($T($('id_of_the_form')).validationError)
document.title = "Blah" + document.title;
}
--
View this message in context: http://tapestry-users.832.n2.nabble.com/Dynamic-Layout-tp5952978p5954906.html
Sent from the Tapestry Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org