Hi Eddy,
I don't see the use of the new template tag. It doesn't add anything,
since it's actually fully handled by the submission declaration.
As you noted, this feature addition could be confusing, and when there
are different submission forms on the same element with the same submit
button names, things can get confusing. However, since you do add a
handler specifically that can be worked around with by the user. How
about automating this completely, like this:
<element implementation="MyElement">
<submission name="editUser">
<bean classname="UserBean"/>
<submit name="save" default="true"/>
<submit name="delete"/>
</submission>
</element>
When the save submit button is pressed, RIFE will look for this method
if it exists:
doEditUserSave
In case of the delete button, it will be:
doEditUserDelete
If the submission is sent without any of the submit parameter names,
RIFE will auto-add the "save" parameter, causing doEditUserSave to be
called.
What do you think of that idea?
Best regards,
Geert
Eddy Young wrote:
> Hi,
>
> There is no easy way to identify which submit button in a form with
> several was pressed when processing a submission. I proposed on IRC the
> idea of having a new tag, say, SUBMISSION:SUBMIT:mybutton, that would be
> recognised as a submit and would be autolinked to a method in the element.
>
> The link will need to be defined in the the element declaration.
>
> Say,
>
> <element implementation="MyElement">
> <submission name="editUser">
> <bean classname="UserBean"/>
> <submit name="mybutton" handler="handleMyButton"/>
> </submission>
>
> </element>
>
>
> "handleMyButton" will be a method of "MyElement" that will automatically
> be called when "mybutton" is pressed.
>
> Off the top of my mind, what I think weighs against implementing this
> is, there will be different ways to process form (by submission and by
> submit button), which could be confusing to developers. For example, if
> the above form is submitted, which method will be called? doEditUser or
> handleMyButton?
>
> What do you think of the proposal?
>
> Eddy
> _______________________________________________
> Rife-users mailing list
> [email protected]
> http://lists.uwyn.com/mailman/listinfo/rife-users
>
--
Geert Bevin Uwyn bvba
"Use what you need" Avenue de Scailmont 34
http://www.uwyn.com 7170 Manage, Belgium
gbevin[remove] at uwyn dot com Tel +32 64 84 80 03
PGP Fingerprint : 4E21 6399 CD9E A384 6619 719A C8F4 D40D 309F D6A9
Public PGP key : available at servers pgp.mit.edu, wwwkeys.pgp.net
_______________________________________________
Rife-users mailing list
[email protected]
http://lists.uwyn.com/mailman/listinfo/rife-users