On Mon, 12 Mar 2012 16:42:13 -0300, TechniciuM <a1098...@rppkn.com> wrote:

Lets assume I have a categorized pages, ie one page is for fruits, the other one is for vegetables and so forth , so on... And that I have menu, and based on which page is turned, it gives the user different menu. So I have a component Menu, and have fruits, vegetables, meat pages. Now I want to put all menu stuff in that component Menu, and based on which page is turned, it gives proper submenus, like for fruits, nuts, berries and for meat it gives me beef, pork and so on... Any ideas how would you implement this, and if
you think I shouldn't do this way, propose the other. Thanks in advance.

You can use this in your component to get the current page being rendered:

@Inject
private ComponentResources resources;

Object page = resources.getPage();

And now use some logic based on the page to determine what's going to be rendered.

--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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

Reply via email to