I just built a dojo tab component for tapestry 3 today and had the same
feature request. (Being that someone can change the tab dynamically via
javascript on the html page and have that state remembered on the server so
it is displayed as-is on next page refresh)

It's pretty easy. Create the component as you normally would, except make it
extend AbstractFormComponent (or implement IFormComponent).

What I did was extend AbstractFormComponent but did the render logic in such
a way that it could work in/out of a containing form. When rendered within a
form it adds a hidden input field to the form (it's part of the IForm
interface) which I then update via a tiny javascript call on the client.
When the component is rewound it just checks  for a parameter with its
component name as any form component would and happily updates the selected
tab state if it finds it. (But doesn't require/validate the input).

Maybe it's not as easy sounding now that I say it, might just be getting too
familiar with tapestry for my own good...

On 7/19/06, Daniel Jue <[EMAIL PROTECTED]> wrote:

Hello,

<Using Tapestry 4, Tomcat 5.5, new to Tapestry>
I am trying to write a simple menu screen, with main menu items and one
list
of sub menu items for each main menu item.  I am duplicating the look and
feel of an existing system, where the main and sub menus are on the same
screen, but in different tables.

Right now I have a MainMenuComponent that renders a list of links.  This
component is embedded in a table on Home.html.

In the next column of this table I want the related sub menus to appear.
The default should be as if the first main menu item was clicked, and I
can
get that with an embedded sub menu component.  But when a user actually
clicks a main menu object, I want the Home.html to re-render itself, and
the
SubMenuComponent to know what was clicked so it can render the right sub
menu items.

What is the best way to store this (session?) info of what was clicked, so
that the SubMenuComponent can have it as input?

Should my MainMenuComponent have SubMenuComponent listed inside it?

I think this "issue" i'm having is similar to using a Tab navigation
system
without a Border component.  Maybe someone can point me to a very vanilla
tapestry Tab tutorial (not the big workbench example)

In fact, I would prefer to use tabs in the future, especially if there
were
no reloads between tabs(using ajax / tacos?)  But for now, I'd like to
know
how to do it this way.

Thanks for any input, this is my first post.

-Dan




--
Jesse Kuhnert
Tacos/Tapestry, team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind.

Reply via email to