You can capture the action even from multiple components:

void onAction() { ... }

But you probably have more than one component that will fire action events
and you don't want all of them to cause a login, so:

void onActionFromLogin() { ...}

Now, you have a second component on your page; component ids have to be
unique, so this other component needs its own id:

<t:actionlink t:id="login2">login another</t:actionlink>

and

void onActionFromLogin2() { return onActionFromLogin(); }



On 5/5/07, Tim Sawyer <[EMAIL PROTECTED]> wrote:

Hi folks,

I had a complex if/then structure in my component's html template, such
that I
want to render different things under different conditions.  Two of the
conditions will result in logins, but with different link text.

I therefore found myself wanting to do:

  @OnEvent(component="login")
  public Login login()
  {
    // ...
  }

in my code, but I can't have the id of both ActionLink components
being "login"

<a href="#" t:type="actionLink" t:id="login">login one way</a>
<a href="#" t:type="actionLink" t:id="login">login another</a>

I therefore ended up having different ids in my html, and trying to catch
them
both with annotations which didn't seem to work either.

Can someone point me in the right direction please?  Or is this not
possible
and I have to write another method for the second login link?

ta,

Tim.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--
Howard M. Lewis Ship
TWD Consulting, Inc.
Independent J2EE / Open-Source Java Consultant
Creator and PMC Chair, Apache Tapestry
Creator, Apache HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com

Reply via email to