On Tue, 07 Aug 2012 05:56:47 -0300, Dimitris Zenios <dimitris.zen...@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-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to