You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by "Robert Zeigler (JIRA)" <ji...@apache.org> on 2009/05/15 19:19:45 UTC
[jira] Updated: (TAP5-705) Let a page choose its layout
[ https://issues.apache.org/jira/browse/TAP5-705?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Robert Zeigler updated TAP5-705:
--------------------------------
Attachment: example.tgz
Attaching a webapp illustrating a dynamically selected layout, done in today's tapestry.
This is just a "proof of principle", basic implementation.
Extract the example, then:
cd example
mvn jetty:run &
point your browser to http://localhost:8080/example
Try out the links.
Examine the source.
> Let a page choose its layout
> ----------------------------
>
> Key: TAP5-705
> URL: https://issues.apache.org/jira/browse/TAP5-705
> Project: Tapestry 5
> Issue Type: Wish
> Components: tapestry-core
> Affects Versions: 5.0.18
> Reporter: Borut Bolcina
> Attachments: example.tgz
>
>
> It would be great if a page could dynamically choose its layout. In some cases the page would use Layout1 component and in some cases Layout2.
> The t:type="${layout}" does not get expanded to whatever I set in Index.java.
> PageWithLayout.tml
> ===============
> <div t:type="${layout}" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
> <p>page with ${layout}</p>
> </div>
> PageWithLayout.java
> ===============
> public class PageWithLayout {
> private String layout;
>
> public String getLayout() {
> return layout;
> }
> public void setLayout(String layout) {
> this.layout = layout;
> }
> }
> Index.tml
> =======
> <t:actionlink t:id="PageWithLayout1">layout1</t:actionlink><br/>
> <t:actionlink t:id="PageWithLayout2">layout2</t:actionlink>
> Index.java
> =======
> public class Index {
> @InjectPage
> private PageWithLayout pageWithLayout;
>
> Object onActionFromPageWithLayout1() {
> pageWithLayout.setLayout("layout1");
> return pageWithLayout;
> }
>
> Object onActionFromPageWithLayout2() {
> pageWithLayout.setLayout("layout2");
> return pageWithLayout;
> }
> }
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.