Question about actionSubmit

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Question about actionSubmit

Pietro Maggi
Hi,
may be I'm missing something, but it seems from example code and from
"FormTagLib.groovy" source (I'm using version 0.1) that is not
possible to assign an action id to a "actionSubmit" tag. It takes it
automagically from the "value" attributes.
This can be a problem if I want an action different from the value
(i18n scenarios comes to mind).
It seems strange to me that this has not surfaced previously, so...
I'm missing something?

Alternatives is to modify the "FormTagLib.groovy" so that it handles
another attribute (something like "action") to disjoin action and
value mapping.

Ciao
Pietro
Reply | Threaded
Open this post in threaded view
|

Re: Question about actionSubmit

graemer
On 4/19/06, Pietro Maggi <[hidden email]> wrote:
> Hi,
> may be I'm missing something, but it seems from example code and from
> "FormTagLib.groovy" source (I'm using version 0.1) that is not
> possible to assign an action id to a "actionSubmit" tag. It takes it
> automagically from the "value" attributes.
> This can be a problem if I want an action different from the value
> (i18n scenarios comes to mind).
> It seems strange to me that this has not surfaced previously, so...
> I'm missing something?
No you're not missing anything this is the case at the moment
unforunately. Unless i'm missing something it seems impossible to set
the "value" that is visible on the button to anything else in an HTML
submit.

>
> Alternatives is to modify the "FormTagLib.groovy" so that it handles
> another attribute (something like "action") to disjoin action and
> value mapping.
There are other ways to handle this scenario.. basically if no action
is specified in the request uri, grails will check if there is a
request parameter called "_action" with the name of the action to
execute.

This could be in a hidden field for example that could be modified via
javascript when you click on the buttons

Just a few suggestions

Cheers
Graeme

>
> Ciao
> Pietro
>
Reply | Threaded
Open this post in threaded view
|

Re: Question about actionSubmit

Pietro Maggi
Hi Graeme,
thanks for your quick reply.

2006/4/19, Graeme Rocher <[hidden email]>:

> On 4/19/06, Pietro Maggi <[hidden email]> wrote:
> > Hi,
> > may be I'm missing something, but it seems from example code and from
> > "FormTagLib.groovy" source (I'm using version 0.1) that is not
> > possible to assign an action id to a "actionSubmit" tag. It takes it
> > automagically from the "value" attributes.
> > This can be a problem if I want an action different from the value
> > (i18n scenarios comes to mind).
> > It seems strange to me that this has not surfaced previously, so...
> > I'm missing something?
> No you're not missing anything this is the case at the moment
> unforunately. Unless i'm missing something it seems impossible to set
> the "value" that is visible on the button to anything else in an HTML
> submit.
>

It seems impossible to me too... :-\

> >
> > Alternatives is to modify the "FormTagLib.groovy" so that it handles
> > another attribute (something like "action") to disjoin action and
> > value mapping.
> There are other ways to handle this scenario.. basically if no action
> is specified in the request uri, grails will check if there is a
> request parameter called "_action" with the name of the action to
> execute.
>
> This could be in a hidden field for example that could be modified via
> javascript when you click on the buttons
>
I'll try this and see how it works.
BTW I have some difficulties locating docs about I18n on the grails
site... can someone guide me on the right page?

ciao
Pietro
Reply | Threaded
Open this post in threaded view
|

Re: Question about actionSubmit

graemer
On 4/19/06, Pietro Maggi <[hidden email]> wrote:

> Hi Graeme,
> thanks for your quick reply.
>
> 2006/4/19, Graeme Rocher <[hidden email]>:
> > On 4/19/06, Pietro Maggi <[hidden email]> wrote:
> > > Hi,
> > > may be I'm missing something, but it seems from example code and from
> > > "FormTagLib.groovy" source (I'm using version 0.1) that is not
> > > possible to assign an action id to a "actionSubmit" tag. It takes it
> > > automagically from the "value" attributes.
> > > This can be a problem if I want an action different from the value
> > > (i18n scenarios comes to mind).
> > > It seems strange to me that this has not surfaced previously, so...
> > > I'm missing something?
> > No you're not missing anything this is the case at the moment
> > unforunately. Unless i'm missing something it seems impossible to set
> > the "value" that is visible on the button to anything else in an HTML
> > submit.
> >
>
> It seems impossible to me too... :-\
>
> > >
> > > Alternatives is to modify the "FormTagLib.groovy" so that it handles
> > > another attribute (something like "action") to disjoin action and
> > > value mapping.
> > There are other ways to handle this scenario.. basically if no action
> > is specified in the request uri, grails will check if there is a
> > request parameter called "_action" with the name of the action to
> > execute.
> >
> > This could be in a hidden field for example that could be modified via
> > javascript when you click on the buttons
> >
> I'll try this and see how it works.
> BTW I have some difficulties locating docs about I18n on the grails
> site... can someone guide me on the right page?
Hmm the docs are a little lacking in this area, but the basics of it
are the message tag:

http://grails.org/Tag+-+message

Which will pull a message from the i18n message bundle in your grails
app based on the locale of the request

I believe we also have still need to configure a locale change
interceptor to support user customisable locale's though

http://static.springframework.org/spring/docs/1.2.x/reference/mvc.html#mvc-localeresolver-interceptor


That is something on the todo list

Graeme

>
> ciao
> Pietro
>