You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Torsten Curdt <tc...@dff.st> on 2002/02/14 13:46:19 UTC
[PROPOSAL] cocoon-action
the latest dicussion revealed a i18n problem with the cocoon-action.
Let's say we have a simple action-set
<action-set>
<action type="..." action="Add"/>
<action type="..." action="Delete"/>
</action-set>
This action-set can be used in HTML as follows
<input type="submit" name="cocoon-action" value="Add">
<input type="submit" name="cocoon-action" value="Delete">
Now here is the problem: the value attribute is the key for the action set
as well as the caption of the input button. Now think of a i18n site. The
HTML should look like for locale "de":
<input type="submit" name="cocoon-action" value="Hinzufuegen">
<input type="submit" name="cocoon-action" value="Loeschen">
But the action-set has still english keys. So you would need an action-set
per lanuage. This is IMHO really *BAD*!!!!!!!
So I propose to change this as follows:
locale en:
<input type="submit" name="cocoon-action-Add" value="Add">
locale de:
<input type="submit" name="cocoon-action-Add" value="Hinzufuegen">
...so there is no i18n dependency. AAAND while changing this I'd also like
to add a way to pass another parameter to the action:
<input type="submit" name="cocoon-action-Add/parametervalue" value="Add">
This would make an MultiAction very easy to implement! :) But I'm sure
there are other use-cases as well...
So I'd like to deprecate the old "cocoon-action" syntax (but still support
it) and like to introduce the new syntax.
[prefix][delimitter][actionkey]{[delimitter][paramtervalue]}
| | | | |
| | | | +-optional:
| | | | will be passed as action
| | | | parameter named (e.g.
| | | | [prefix]-paramter)
| | | |
| | | +------- introduce the parametervalue
| | | (e.g. '/')
| | |
| | +------------------- the key of action (the value
| | attribute of the current impl)
| |
| +------------------------------- (e.g. '-' or ':')
|
+----------------------------------------- prefix (e.g. again 'cocoon-action')
What do guys think?
--
Torsten
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: [PROPOSAL] cocoon-action
Posted by Andrew Answer <A....@ftc.ru>.
Hello Torsten,
+1! As Russian user i'm also join to initiative. Separate
flying button text and internal Cocoon millstone - it's a good idea.
Your new syntax look not so bad. Try it.
>*************Original message*************
> From: Torsten Curdt <tc...@dff.st>
> To: cocoon-dev@xml.apache.org <co...@xml.apache.org>
> Date: Thursday, February 14, 2002, 6:46:19 PM
> Subject: [PROPOSAL] cocoon-action
> the latest dicussion revealed a i18n problem with the cocoon-action.
> Let's say we have a simple action-set
> <action-set>
> <action type="..." action="Add"/>
> <action type="..." action="Delete"/>
> </action-set>
> This action-set can be used in HTML as follows
> <input type="submit" name="cocoon-action" value="Add">
> <input type="submit" name="cocoon-action" value="Delete">
> Now here is the problem: the value attribute is the key for the action set
> as well as the caption of the input button. Now think of a i18n site. The
> HTML should look like for locale "de":
> <input type="submit" name="cocoon-action" value="Hinzufuegen">
> <input type="submit" name="cocoon-action" value="Loeschen">
> But the action-set has still english keys. So you would need an action-set
> per lanuage. This is IMHO really *BAD*!!!!!!!
> So I propose to change this as follows:
> locale en:
> <input type="submit" name="cocoon-action-Add" value="Add">
> locale de:
> <input type="submit" name="cocoon-action-Add" value="Hinzufuegen">
> ...so there is no i18n dependency. AAAND while changing this I'd also like
> to add a way to pass another parameter to the action:
> <input type="submit" name="cocoon-action-Add/parametervalue" value="Add">
> This would make an MultiAction very easy to implement! :) But I'm sure
> there are other use-cases as well...
> So I'd like to deprecate the old "cocoon-action" syntax (but still support
> it) and like to introduce the new syntax.
> [prefix][delimitter][actionkey]{[delimitter][paramtervalue]}
> | | | | |
> | | | | +-optional:
> | | | | will be passed as action
> | | | | parameter named (e.g.
> | | | | [prefix]-paramter)
> | | | |
> | | | +------- introduce the parametervalue
> | | | (e.g. '/')
> | | |
> | | +------------------- the key of action (the value
> | | attribute of the current impl)
> | |
> | +------------------------------- (e.g. '-' or ':')
> |
> +----------------------------------------- prefix (e.g. again 'cocoon-action')
> What do guys think?
> --
> Torsten
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
>*************Original message*************
Best regards,
Andrew Answer A.Nuzhdov@ftc.ru
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
RE: [PROPOSAL] cocoon-action
Posted by Vadim Gritsenko <va...@verizon.net>.
> From: Torsten Curdt [mailto:tcurdt@dff.st]
>
> > Suggestion: Isn't it better to add another parameter instead of
clogging
> > cocoon-action? I mean:
> >
> > Instead of:
> > <input type="submit" name="cocoon-action-Add/parametervalue"
> > value="Add">
> >
> > Have:
> > <input type="submit" name="cocoon-action-add" value="Add">
> > <input type="hidden" name="cocoon-action-parameter"
> > value="parametervalue">
> >
> > Hope it fits into your applications as well as
> > "cocoon-action-Add/parametervalue" or even better.
>
> That's true of course! This would be much nicer but will not work
because
> of same reason the hidden input example Carsten suggested will not
work.
> -> More than one submit button per form.
>
> Anyway, I already implemented the new syntax (just haven't yet
commited it
> yet) but left out the parameter stuff. (need to get my webapp running
with
> all the new stuff to try it out ;)
>
> But you gave me an idea... what about this:
>
> <input type="submit" name="cocoon-action-add" value="Add">
> <input type="hidden" name="cocoon-action-add-parameter"
> value="parametervalue">
>
> Note that name is the same as the submit button's plus a postfix.
> Cool! This does not even need a change in single line of code....
> The action only have to know it's "name" or key
>
> Sometimes it's that simple you don't see it :)
:)
The way to go then!
Vadim
> --
> Torsten
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
RE: [PROPOSAL] cocoon-action
Posted by Torsten Curdt <tc...@dff.st>.
> Suggestion: Isn't it better to add another parameter instead of clogging
> cocoon-action? I mean:
>
> Instead of:
> <input type="submit" name="cocoon-action-Add/parametervalue"
> value="Add">
>
> Have:
> <input type="submit" name="cocoon-action-add" value="Add">
> <input type="hidden" name="cocoon-action-parameter"
> value="parametervalue">
>
> Hope it fits into your applications as well as
> "cocoon-action-Add/parametervalue" or even better.
That's true of course! This would be much nicer but will not work because
of same reason the hidden input example Carsten suggested will not work.
-> More than one submit button per form.
Anyway, I already implemented the new syntax (just haven't yet commited it
yet) but left out the parameter stuff. (need to get my webapp running with
all the new stuff to try it out ;)
But you gave me an idea... what about this:
<input type="submit" name="cocoon-action-add" value="Add">
<input type="hidden" name="cocoon-action-add-parameter" value="parametervalue">
Note that name is the same as the submit button's plus a postfix.
Cool! This does not even need a change in single line of code....
The action only have to know it's "name" or key
Sometimes it's that simple you don't see it :)
--
Torsten
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
RE: [PROPOSAL] cocoon-action
Posted by Vadim Gritsenko <va...@verizon.net>.
Torsten,
Suggestion: Isn't it better to add another parameter instead of clogging
cocoon-action? I mean:
Instead of:
<input type="submit" name="cocoon-action-Add/parametervalue"
value="Add">
Have:
<input type="submit" name="cocoon-action-add" value="Add">
<input type="hidden" name="cocoon-action-parameter"
value="parametervalue">
Hope it fits into your applications as well as
"cocoon-action-Add/parametervalue" or even better.
Vadim
> -----Original Message-----
> From: Torsten Curdt [mailto:tcurdt@dff.st]
> Sent: Thursday, February 14, 2002 7:46 AM
> To: cocoon-dev@xml.apache.org
> Subject: [PROPOSAL] cocoon-action
>
> the latest dicussion revealed a i18n problem with the cocoon-action.
> Let's say we have a simple action-set
>
> <action-set>
> <action type="..." action="Add"/>
> <action type="..." action="Delete"/>
> </action-set>
>
> This action-set can be used in HTML as follows
>
> <input type="submit" name="cocoon-action" value="Add">
> <input type="submit" name="cocoon-action" value="Delete">
>
> Now here is the problem: the value attribute is the key for the action
set
> as well as the caption of the input button. Now think of a i18n site.
The
> HTML should look like for locale "de":
>
> <input type="submit" name="cocoon-action" value="Hinzufuegen">
> <input type="submit" name="cocoon-action" value="Loeschen">
>
> But the action-set has still english keys. So you would need an
action-set
> per lanuage. This is IMHO really *BAD*!!!!!!!
>
> So I propose to change this as follows:
>
> locale en:
> <input type="submit" name="cocoon-action-Add" value="Add">
>
> locale de:
> <input type="submit" name="cocoon-action-Add" value="Hinzufuegen">
>
> ...so there is no i18n dependency. AAAND while changing this I'd also
like
> to add a way to pass another parameter to the action:
>
> <input type="submit" name="cocoon-action-Add/parametervalue"
value="Add">
>
> This would make an MultiAction very easy to implement! :) But I'm sure
> there are other use-cases as well...
>
> So I'd like to deprecate the old "cocoon-action" syntax (but still
support
> it) and like to introduce the new syntax.
>
> [prefix][delimitter][actionkey]{[delimitter][paramtervalue]}
> | | | | |
> | | | | +-optional:
> | | | | will be passed
as action
> | | | | parameter named
(e.g.
> | | | |
[prefix]-paramter)
> | | | |
> | | | +------- introduce the
parametervalue
> | | | (e.g. '/')
> | | |
> | | +------------------- the key of action (the
value
> | | attribute of the
current impl)
> | |
> | +------------------------------- (e.g. '-' or ':')
> |
> +----------------------------------------- prefix (e.g. again
'cocoon-
> action')
>
> What do guys think?
> --
> Torsten
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
RE: [PROPOSAL] cocoon-action
Posted by giacomo <gi...@apache.org>.
On Thu, 14 Feb 2002, Carsten Ziegeler wrote:
> Hm,
>
> why don't you use a hidden input field in your form instead
> of using the submit button?
>
> <input type="hidden" name="cocoon-action" value="Add"/>
>
> This is language independent and submit button text independent
> and works.
It doesn't work if you have more that one button to choose for an action
(Update & Delete).
Giacomo
>
> Carsten
>
> > Torsten Curdt wrote:
> > -----Original Message-----
> > From: Torsten Curdt [mailto:tcurdt@dff.st]
> > Sent: Thursday, February 14, 2002 1:46 PM
> > To: cocoon-dev@xml.apache.org
> > Subject: [PROPOSAL] cocoon-action
> >
> >
> > the latest dicussion revealed a i18n problem with the cocoon-action.
> > Let's say we have a simple action-set
> >
> > <action-set>
> > <action type="..." action="Add"/>
> > <action type="..." action="Delete"/>
> > </action-set>
> >
> > This action-set can be used in HTML as follows
> >
> > <input type="submit" name="cocoon-action" value="Add">
> > <input type="submit" name="cocoon-action" value="Delete">
> >
> > Now here is the problem: the value attribute is the key for the action set
> > as well as the caption of the input button. Now think of a i18n site. The
> > HTML should look like for locale "de":
> >
> > <input type="submit" name="cocoon-action" value="Hinzufuegen">
> > <input type="submit" name="cocoon-action" value="Loeschen">
> >
> > But the action-set has still english keys. So you would need an action-set
> > per lanuage. This is IMHO really *BAD*!!!!!!!
> >
> > So I propose to change this as follows:
> >
> > locale en:
> > <input type="submit" name="cocoon-action-Add" value="Add">
> >
> > locale de:
> > <input type="submit" name="cocoon-action-Add" value="Hinzufuegen">
> >
> > ...so there is no i18n dependency. AAAND while changing this I'd also like
> > to add a way to pass another parameter to the action:
> >
> > <input type="submit" name="cocoon-action-Add/parametervalue"
> > value="Add">
> >
> > This would make an MultiAction very easy to implement! :) But I'm sure
> > there are other use-cases as well...
> >
> > So I'd like to deprecate the old "cocoon-action" syntax (but still support
> > it) and like to introduce the new syntax.
> >
> > [prefix][delimitter][actionkey]{[delimitter][paramtervalue]}
> > | | | | |
> > | | | | +-optional:
> > | | | | will be
> > passed as action
> > | | | | parameter
> > named (e.g.
> > | | | | [prefix]-paramter)
> > | | | |
> > | | | +------- introduce the
> > parametervalue
> > | | | (e.g. '/')
> > | | |
> > | | +------------------- the key of action
> > (the value
> > | | attribute of the
> > current impl)
> > | |
> > | +------------------------------- (e.g. '-' or ':')
> > |
> > +----------------------------------------- prefix (e.g. again
> > 'cocoon-action')
> >
> > What do guys think?
> > --
> > Torsten
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> > For additional commands, email: cocoon-dev-help@xml.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
RE: [PROPOSAL] cocoon-action
Posted by Carsten Ziegeler <cz...@s-und-n.de>.
> Torsten Curdt wrote:
>
> On Thu, 14 Feb 2002, Carsten Ziegeler wrote:
>
> > Hm,
> >
> > why don't you use a hidden input field in your form instead
> > of using the submit button?
> >
> > <input type="hidden" name="cocoon-action" value="Add"/>
> >
> > This is language independent and submit button text independent
> > and works.
>
> This is not sufficient. What's up when you have more than one submit
> buttons i one form? ...all you *could* (but don't want to) do is to change
> the hidden inputs with javascript. How would to do this with hidden inputs
>
> <form>
> <input type="submit" name="cocoon-action-Add" value="Add">
> <input type="submit" name="cocoon-action-Delete" value="Delete">
> </form>
>
> As soon as you insert a hidden input for the action selection you form is
> tied to one action
Yes, that's true. Sorry, I didn't think of forms with multiple submit
buttons.
Carsten
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
RE: [PROPOSAL] cocoon-action
Posted by Torsten Curdt <tc...@dff.st>.
On Thu, 14 Feb 2002, Carsten Ziegeler wrote:
> Hm,
>
> why don't you use a hidden input field in your form instead
> of using the submit button?
>
> <input type="hidden" name="cocoon-action" value="Add"/>
>
> This is language independent and submit button text independent
> and works.
This is not sufficient. What's up when you have more than one submit
buttons i one form? ...all you *could* (but don't want to) do is to change
the hidden inputs with javascript. How would to do this with hidden inputs
<form>
<input type="submit" name="cocoon-action-Add" value="Add">
<input type="submit" name="cocoon-action-Delete" value="Delete">
</form>
As soon as you insert a hidden input for the action selection you form is
tied to one action
--
Torsten
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
RE: [PROPOSAL] cocoon-action
Posted by Carsten Ziegeler <cz...@s-und-n.de>.
Hm,
why don't you use a hidden input field in your form instead
of using the submit button?
<input type="hidden" name="cocoon-action" value="Add"/>
This is language independent and submit button text independent
and works.
Carsten
> Torsten Curdt wrote:
> -----Original Message-----
> From: Torsten Curdt [mailto:tcurdt@dff.st]
> Sent: Thursday, February 14, 2002 1:46 PM
> To: cocoon-dev@xml.apache.org
> Subject: [PROPOSAL] cocoon-action
>
>
> the latest dicussion revealed a i18n problem with the cocoon-action.
> Let's say we have a simple action-set
>
> <action-set>
> <action type="..." action="Add"/>
> <action type="..." action="Delete"/>
> </action-set>
>
> This action-set can be used in HTML as follows
>
> <input type="submit" name="cocoon-action" value="Add">
> <input type="submit" name="cocoon-action" value="Delete">
>
> Now here is the problem: the value attribute is the key for the action set
> as well as the caption of the input button. Now think of a i18n site. The
> HTML should look like for locale "de":
>
> <input type="submit" name="cocoon-action" value="Hinzufuegen">
> <input type="submit" name="cocoon-action" value="Loeschen">
>
> But the action-set has still english keys. So you would need an action-set
> per lanuage. This is IMHO really *BAD*!!!!!!!
>
> So I propose to change this as follows:
>
> locale en:
> <input type="submit" name="cocoon-action-Add" value="Add">
>
> locale de:
> <input type="submit" name="cocoon-action-Add" value="Hinzufuegen">
>
> ...so there is no i18n dependency. AAAND while changing this I'd also like
> to add a way to pass another parameter to the action:
>
> <input type="submit" name="cocoon-action-Add/parametervalue"
> value="Add">
>
> This would make an MultiAction very easy to implement! :) But I'm sure
> there are other use-cases as well...
>
> So I'd like to deprecate the old "cocoon-action" syntax (but still support
> it) and like to introduce the new syntax.
>
> [prefix][delimitter][actionkey]{[delimitter][paramtervalue]}
> | | | | |
> | | | | +-optional:
> | | | | will be
> passed as action
> | | | | parameter
> named (e.g.
> | | | | [prefix]-paramter)
> | | | |
> | | | +------- introduce the
> parametervalue
> | | | (e.g. '/')
> | | |
> | | +------------------- the key of action
> (the value
> | | attribute of the
> current impl)
> | |
> | +------------------------------- (e.g. '-' or ':')
> |
> +----------------------------------------- prefix (e.g. again
> 'cocoon-action')
>
> What do guys think?
> --
> Torsten
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org