You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Dimitris Zenios <di...@gmail.com> on 2012/08/06 21:03:44 UTC

+ zone

Is there a way to have a layout component and all its body would be
rendered using zone?Just like google plus does when you change between
pages.

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


Re: + zone

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Tue, 07 Aug 2012 05:56:47 -0300, Dimitris Zenios  
<di...@gmail.com> wrote:

> I was talking of something like this.
>
> <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd">
>     <head>
>         <title>My Nifty Web Application</title>
>     </head>
>     <body>
>         <div class="nav-top">
>             Nifty Web Application
>             <t:pagelink t:page="index">Index</t:pagelink>
>             <t:pagelink t:page="about">About</t:pagelink>
>         </div>
>
>         <t:alerts/>
>         <t:zone t:id="hello">
>         <t:body/>
>         </t:zone>
>
>         <div class="nav-bottom">
>             (C) 2008 NiftyWebCo, Inc.
>         </div>
>     </body>
> </html>

This will work for the Index page. In this case, you won't need a Layout  
one because Index will serve as that.

> one layout two pages Index and about.If pagelinks are used then the
> <t:body> is not rendered through ajax called..Most probably i have to
> use eventlinks but i dont know how through the callback i will load
> the appropriate <t:body> of the page (Index or about)

Don't use PageLink. Forget about <t:body> in this case. Use EventLink with  
zone="hello" and return a Block or component instance. Using this  
approach, you'll need to have all the content in the same page and use the  
Environment for passing information. But you can try using different  
pages, but you won't be able to use the activation context for them.  
Instead, you'd need to use the Environment for passing data. For rendering  
other pages, try this (not tested):

@Inject
private ComponentSource componentSource;

@Inject
private Environment environment;

Object onNameOfYourEvent() { // maybe some parameters for context
	Class pageClass = ...; // logic for determining next page. You can also  
use String instead.
	environment.push(); // passing information.
	return  
componentSource.getPage(pageClass).getComponentResources().getBody();
}

-- 
Thiago H. de Paula Figueiredo

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


Re: + zone

Posted by Dimitris Zenios <di...@gmail.com>.
I was talking of something like this.

<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd">
    <head>
        <title>My Nifty Web Application</title>
    </head>
    <body>
        <div class="nav-top">
            Nifty Web Application
            <t:pagelink t:page="index">Index</t:pagelink>
            <t:pagelink t:page="about">About</t:pagelink>
        </div>

        <t:alerts/>
        <t:zone t:id="hello">
        <t:body/>
        </t:zone>

        <div class="nav-bottom">
            (C) 2008 NiftyWebCo, Inc.
        </div>
    </body>
</html>

one layout two pages Index and about.If pagelinks are used then the
<t:body> is not rendered through ajax called..Most probably i have to
use eventlinks but i dont know how through the callback i will load
the appropriate <t:body> of the page (Index or about)


<t:body> element should be loaded through ajax calls.
On Tue, Aug 7, 2012 at 4:44 AM, Thiago H de Paula Figueiredo
<th...@gmail.com> wrote:
> On Mon, 06 Aug 2012 19:36:17 -0300, Dimitris Zenios
> <di...@gmail.com> wrote:
>
>> Any example or a hint please?
>
>
> Layout.tml:
>
> <t:zone t:id="zone" ...>
>
> </t:zone>
>
>
>>
>> On Tue, Aug 7, 2012 at 12:13 AM, Thiago H de Paula Figueiredo
>> <th...@gmail.com> wrote:
>>>
>>> On Mon, 06 Aug 2012 16:03:44 -0300, Dimitris Zenios
>>> <di...@gmail.com> wrote:
>>>
>>>> Is there a way to have a layout component and all its body would be
>>>> rendered using zone?
>>>
>>>
>>>
>>> Yes, why not?
>>>
>>> --
>>> Thiago H. de Paula Figueiredo
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>
>
> --
> Thiago H. de Paula Figueiredo
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>

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


Re: + zone

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Mon, 06 Aug 2012 19:36:17 -0300, Dimitris Zenios  
<di...@gmail.com> wrote:

> Any example or a hint please?

Layout.tml:

<t:zone t:id="zone" ...>
	
</t:zone>

>
> On Tue, Aug 7, 2012 at 12:13 AM, Thiago H de Paula Figueiredo
> <th...@gmail.com> wrote:
>> On Mon, 06 Aug 2012 16:03:44 -0300, Dimitris Zenios
>> <di...@gmail.com> wrote:
>>
>>> Is there a way to have a layout component and all its body would be
>>> rendered using zone?
>>
>>
>> Yes, why not?
>>
>> --
>> Thiago H. de Paula Figueiredo
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>


-- 
Thiago H. de Paula Figueiredo

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


Re: + zone

Posted by Dimitris Zenios <di...@gmail.com>.
Any example or a hint please?

On Tue, Aug 7, 2012 at 12:13 AM, Thiago H de Paula Figueiredo
<th...@gmail.com> wrote:
> On Mon, 06 Aug 2012 16:03:44 -0300, Dimitris Zenios
> <di...@gmail.com> wrote:
>
>> Is there a way to have a layout component and all its body would be
>> rendered using zone?
>
>
> Yes, why not?
>
> --
> Thiago H. de Paula Figueiredo
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>

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


Re: + zone

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Mon, 06 Aug 2012 16:03:44 -0300, Dimitris Zenios  
<di...@gmail.com> wrote:

> Is there a way to have a layout component and all its body would be
> rendered using zone?

Yes, why not?

-- 
Thiago H. de Paula Figueiredo

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