Hi,

Thanks that's what I needed. I have now the global items in my Layout
component. And I can add some from within a Page as a parameter.

My code at the moment (simplified):

*Layout.tml:*

<div id="sidePanel">
[items that are shown on every page]
<t:delegate to="sidePanelContent" />
</div>

*Layout.java:*

@Parameter
private Block sidePanel;

public Object getSidePanelContent() {
                return sidePanel;
}

*Dashboard.tml:*

<p:sidePanel>
     ${policy.holder.name}
</p:sidePanel>

*Dashboard.java*

@Property
private Policy policy;

Object onActivate(Policy policy) {
     this.policy = policy;
}


This works...
Now what if I have another page, lets say "Simulation". And I want to add
that same content as a parameter like in "Dashboard". How can I reuse this
code instead of adding this in every page I want to show this in.

I've tried making an extra component between the Layout and the Page where I
put the common content to be added in a parameter. But then I had a problem
accessing needed properties from my pages (policy in my example)

Then I thought I could use inheritance and put the onActivate method in the
parent class. But I think that's not gonna solve my problem...

Maybe I should just create a component for each type of content I want to
add to the sidePanel and in every page add the wanted components..?



Hope you understand what I meant in my above rant and can give your thoughts
on this.

Thanks

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Sidepanel-with-pagespecific-items-tp5679939p5680371.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

Reply via email to