You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Harring Figueiredo <ha...@gmail.com> on 2007/04/05 23:26:43 UTC

S2: Design Input suggestion

Folks:


I have a form that is rendered by calling an action from a get or a put.

In  "edit" mode, the fields are pre-populated from the POJO (param to get
the POJO is passed on the URL GET).
In "create" mode, the fields are, of course, empty.

The design issue I am having has to do with the Validation.
If I turn on validation, then when the Action is called for the create mode,
the the validators intercept an reders the form with
the errors (i.e. "Missing Field Blah")

What is the best way you guys handle this situation?

Thanks in advance.

hff

Re: S2: Design Input suggestion

Posted by Harring Figueiredo <ha...@gmail.com>.
Joey,

Thank you so much for you input. I will take a look again at the showcase
application code and see the detail of it. I was not aware that we could
setup interceptors like that -- Your input on this is greatly appreciated.

Regards,

Harring Figueiredo

On 4/5/07, joey <re...@gmail.com> wrote:
>
> I don't think you should turn on validation in "edit" mode or "create"
> mode.
> Validation is only needed in "save" mode.
> "edit" mode or "create" mode is just to show field data,no submit.
> You can set validation only work for "save" mode like this:
> Add        <interceptor-ref name="crudStack">
>                 <param name="validation.excludeMethods
> ">edit,create</param>
>             </interceptor-ref>
> in edit or create mode configuration file.
> Btw.edit and create could be done in one method.It's more compact.
> You can refer to the crud example in the showcase app.
>
> On 4/6/07, Harring Figueiredo <ha...@gmail.com> wrote:
> >
> > Folks:
> >
> >
> > I have a form that is rendered by calling an action from a get or a put.
> >
> > In  "edit" mode, the fields are pre-populated from the POJO (param to
> get
> > the POJO is passed on the URL GET).
> > In "create" mode, the fields are, of course, empty.
> >
> > The design issue I am having has to do with the Validation.
> > If I turn on validation, then when the Action is called for the create
> > mode,
> > the the validators intercept an reders the form with
> > the errors (i.e. "Missing Field Blah")
> >
> > What is the best way you guys handle this situation?
> >
> > Thanks in advance.
> >
> > hff
> >
>



-- 
Sincerely,

Harring Figueiredo
Sr. Software Engineer
Email: harringf@gmail.com
Telephone: 941-256-0600

"We never become truly spiritual by sitting down and wishing to become so.
You must undertake something so great that you cannot accomplish it
unaided."

Re: S2: Design Input suggestion

Posted by joey <re...@gmail.com>.
I don't think you should turn on validation in "edit" mode or "create" mode.
Validation is only needed in "save" mode.
"edit" mode or "create" mode is just to show field data,no submit.
You can set validation only work for "save" mode like this:
Add        <interceptor-ref name="crudStack">
                <param name="validation.excludeMethods">edit,create</param>
            </interceptor-ref>
in edit or create mode configuration file.
Btw.edit and create could be done in one method.It's more compact.
You can refer to the crud example in the showcase app.

On 4/6/07, Harring Figueiredo <ha...@gmail.com> wrote:
>
> Folks:
>
>
> I have a form that is rendered by calling an action from a get or a put.
>
> In  "edit" mode, the fields are pre-populated from the POJO (param to get
> the POJO is passed on the URL GET).
> In "create" mode, the fields are, of course, empty.
>
> The design issue I am having has to do with the Validation.
> If I turn on validation, then when the Action is called for the create
> mode,
> the the validators intercept an reders the form with
> the errors (i.e. "Missing Field Blah")
>
> What is the best way you guys handle this situation?
>
> Thanks in advance.
>
> hff
>