action="listener:doHelp" will work. It also has the benefit of not invoking an ognl call. As a general rule, use binding prefixes whenever possible to avoid ognl.

You might also want to check out the Tapestry-Prop library (http://howardlewisship.com/tapestry-javaforge/tapestry-prop/) to get noticeable performance gains by replacing even more ognl calls. The documentation says that properties called with prop: "may be read-only or write-only" but I've been using it for just about everything with no problem (except it seems to choke on Integers and Doubles for some reason).

-Ryan

Matt Raible wrote:
Jesse Kuhnert wrote:

Don't use the listener= parameter, use action="" . Listeners will always
strive to find the most "direct" path to invoking your method, which in the case of forms means as soon as the template parser sees it in the component
tree.

Thanks Jesse, that did the trick. I changed listener="ognl:listeners.save" to action="ognl:listeners.save" and the problem is now solved. As far as the @Submit component's documention, it lists action="listener:doHelp" as an example. Will this work, or is "ognl:listener/*s*/:method" the only syntax that will work?

Matt


Action listeners on the other hand will safely be invoked only after the
form values have been bound. I question the usefulness of having the
listener parameters on forms or submit buttons at all sometimes.

On 5/29/06, Matt Raible <[EMAIL PROTECTED]> wrote:


I'm trying to put duplicate "button bars" on a form. The top of my form
has:

    <li class="buttonBar right">
        <input type="submit" class="button" jwcid="@Submit"
value="message:button.save" id="save" listener="ognl:listeners.save"/>
          <span jwcid="@If" condition="ognl:user.username != null">
            <input type="submit" class="button" jwcid="@Submit"
value="message:button.delete" id="delete" listener="ognl:listeners.delete"
                onclick="form.onsubmit = null; return
confirmDelete('User')"/>
          </span>
        <input type="submit" class="button" jwcid="@Submit"
value="message:button.cancel" id="cancel" listener="ognl:listeners.cancel"
            onclick="form.onsubmit = null"/>
    </li>

The bottom of my form has almost exactly the same thing:

    <li class="buttonBar bottom">
        <input type="submit" class="button" jwcid="@Submit"
value="message:button.save" id="save" listener="ognl:listeners.save"/>
        <span jwcid="@If" condition="ognl:user.username != null">
        <input type="submit" class="button" jwcid="@Submit"
value="message:button.delete" id="delete" listener="ognl:listeners.delete" onclick="form.onsubmit = null; return confirmDelete('User')"/>
        </span>
        <input type="submit" class="button" jwcid="@Submit"
value="message:button.cancel" id="cancel" listener="ognl:listeners.cancel"
            onclick="form.onsubmit = null"/>
    </li>

The strange thing is, if I click on any of the top buttons (which occur
before any form elements), no form fields are passed in.  However, if I
click on the bottom set of buttons, everything works.  Is there a
limitation in Tapestry where you can't have two sets of the same submit
buttons?  This works in all the other web frameworks I've used.

The raw source of my form can be found at:
http://rifers.org/paste/show/828
The rendered source of my form can be found at:
http://rifers.org/paste/show/827

I've validated the rendered source of my page with validator.w3.org and
it validates as XHTML transitional.

Thanks,

Matt


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







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



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

Reply via email to