In a form, you can do something like:

  <form name="myForm" action="$link.setAction("myAction")">
    ...
    <input type="submit" name="eventSubmit_doFirst" value="First Action">
    <input type="submit" name="eventSubmit_doSecond" value="Second Action">
  </form>

and this will end up locating an Action class named myAction, and
calling its method doFirst() or doSecond(), depending on which
submit button was pressed. Very nice.

Is there any way to replace those buttons with links? In other
words, I would like to have two links:

  <a href="$link.MAGIC">First Action</a>
  <a href="$link.MAGIC">Second Action</a>

and have the first link act as the first submit button, and the
second link act as the second submit button. The problem I see
is that there is no way to specify the action for a link; MAGIC
can only be, as far as I know,

  setAction("myAction")

but that doesn't specify the method to call, and the link will
end up calling method doPerform().

If this is an accurate description for the way links are handled,
maybe this would be a good reason to add an alternative syntax
for specifying actions; for example:

  <a href="$link.setAction("myAction:doFirst")">First Action</a>
  <a href="$link.setAction("myAction:doSecond")">Second Action</a>

which could also be used instead of "eventSubmit_XXX":

<form name="myForm" action="$link.setAction("myAction")">
  ...
  <input type="submit" name=":doFirst" value="First Action">
  <input type="submit" name=":doSecond" value="Second Action">
</form>

Any hints or comments? Thanks,


-- 
Gonzalo A. Diethelm
[EMAIL PROTECTED]

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

Reply via email to