You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by st...@gmail.com on 2007/04/24 21:28:59 UTC
S2 Tag Properties
I notice key is now preferred over getText() and am now curious about
something else. Is the name attribute necessary when using key? I would
rather not duplicate myself unless S2 requires it.
<s:textfield name="user.zip.city" key="user.zip.city" size="40"
readonly="true" />
--
Scott
stanlick@gmail.com
Re: Reset struts form values: Struts 1.3
Posted by Lance <la...@marketpipe.com>.
true
Mike Baroukh wrote:
> > You could use a reset button
> > <input type="reset" value="Label for reset button" />
>
> It don't always work because it reset to the values that were
> populated on page load.
> The case it don't work is when you make a change on a form, post it
> and there was errors. The form is loaded again with the wrong values
> you previously typed and an error message. If you push a "reset
> button", it will reset to the wrong values ...
> The only way is to use an action for this.
>
> Mike
>
> Lance a écrit :
>> You could use a reset button
>> <input type="reset" value="Label for reset button" />
>>
>> Chaudhary, Harsh wrote:
>>> Yea, that's what I was thinking too. I was just wondering if Struts (or
>>> some other API) has a built-in caching mechanism. Thanks though,
>>> Harsh.
>>>
>>> -----Original Message-----
>>> From: paulus.benedictus@gmail.com [mailto:paulus.benedictus@gmail.com]
>>> On Behalf Of Paul Benedict
>>> Sent: Tuesday, April 24, 2007 4:55 PM
>>> To: Struts Users Mailing List
>>> Subject: Re: Reset struts form values: Struts 1.3
>>>
>>>
>>> Chaudhary, Harsh <HC...@amfam.com> wrote:
>>>
>>>> Hi,
>>>>
>>>> I am using Struts 1.3. We have several struts forms which are
>>>> pre-populated from a database.
>>>>
>>>> My questions is, if I want to provide the user with a way to reset the
>>>> form to the initial values which were populated from the database.
>>>>
>>>
>>>
>>>
>>> It sounds like you will be providing a button for this choice. If so,
>>> then
>>> wire it up to a Struts action which will get the values from the
>>> database.
>>> Or if those values are cached in application scope, just retrieve those
>>> again.
>>>
>>> Paul
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Reset struts form values: Struts 1.3
Posted by Mike Baroukh <mb...@cardiweb.com>.
> You could use a reset button
> <input type="reset" value="Label for reset button" />
It don't always work because it reset to the values that were populated
on page load.
The case it don't work is when you make a change on a form, post it and
there was errors. The form is loaded again with the wrong values you
previously typed and an error message. If you push a "reset button", it
will reset to the wrong values ...
The only way is to use an action for this.
Mike
Lance a écrit :
> You could use a reset button
> <input type="reset" value="Label for reset button" />
>
> Chaudhary, Harsh wrote:
>> Yea, that's what I was thinking too. I was just wondering if Struts (or
>> some other API) has a built-in caching mechanism. Thanks though,
>> Harsh.
>>
>> -----Original Message-----
>> From: paulus.benedictus@gmail.com [mailto:paulus.benedictus@gmail.com]
>> On Behalf Of Paul Benedict
>> Sent: Tuesday, April 24, 2007 4:55 PM
>> To: Struts Users Mailing List
>> Subject: Re: Reset struts form values: Struts 1.3
>>
>>
>> Chaudhary, Harsh <HC...@amfam.com> wrote:
>>
>>> Hi,
>>>
>>> I am using Struts 1.3. We have several struts forms which are
>>> pre-populated from a database.
>>>
>>> My questions is, if I want to provide the user with a way to reset the
>>> form to the initial values which were populated from the database.
>>>
>>
>>
>>
>> It sounds like you will be providing a button for this choice. If so,
>> then
>> wire it up to a Struts action which will get the values from the
>> database.
>> Or if those values are cached in application scope, just retrieve those
>> again.
>>
>> Paul
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
--
Mike Baroukh
---
Cardiweb - 31 Rue de Mogador Paris IXeme
06 63 57 27 22 - 01 53 21 82 63 - Jabber: mbaroukh@jabber.org
http://www.cardiweb.com
---
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Reset struts form values: Struts 1.3
Posted by Lance <la...@marketpipe.com>.
You could use a reset button
<input type="reset" value="Label for reset button" />
Chaudhary, Harsh wrote:
> Yea, that's what I was thinking too. I was just wondering if Struts (or
> some other API) has a built-in caching mechanism. Thanks though,
> Harsh.
>
> -----Original Message-----
> From: paulus.benedictus@gmail.com [mailto:paulus.benedictus@gmail.com]
> On Behalf Of Paul Benedict
> Sent: Tuesday, April 24, 2007 4:55 PM
> To: Struts Users Mailing List
> Subject: Re: Reset struts form values: Struts 1.3
>
>
> Chaudhary, Harsh <HC...@amfam.com> wrote:
>
>> Hi,
>>
>> I am using Struts 1.3. We have several struts forms which are
>> pre-populated from a database.
>>
>> My questions is, if I want to provide the user with a way to reset the
>> form to the initial values which were populated from the database.
>>
>
>
>
> It sounds like you will be providing a button for this choice. If so,
> then
> wire it up to a Struts action which will get the values from the
> database.
> Or if those values are cached in application scope, just retrieve those
> again.
>
> Paul
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
RE: Reset struts form values: Struts 1.3
Posted by "Chaudhary, Harsh" <HC...@amfam.com>.
Yea, that's what I was thinking too. I was just wondering if Struts (or
some other API) has a built-in caching mechanism. Thanks though,
Harsh.
-----Original Message-----
From: paulus.benedictus@gmail.com [mailto:paulus.benedictus@gmail.com]
On Behalf Of Paul Benedict
Sent: Tuesday, April 24, 2007 4:55 PM
To: Struts Users Mailing List
Subject: Re: Reset struts form values: Struts 1.3
Chaudhary, Harsh <HC...@amfam.com> wrote:
>
> Hi,
>
> I am using Struts 1.3. We have several struts forms which are
> pre-populated from a database.
>
> My questions is, if I want to provide the user with a way to reset the
> form to the initial values which were populated from the database.
It sounds like you will be providing a button for this choice. If so,
then
wire it up to a Struts action which will get the values from the
database.
Or if those values are cached in application scope, just retrieve those
again.
Paul
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Reset struts form values: Struts 1.3
Posted by Paul Benedict <pb...@apache.org>.
Chaudhary, Harsh <HC...@amfam.com> wrote:
>
> Hi,
>
> I am using Struts 1.3. We have several struts forms which are
> pre-populated from a database.
>
> My questions is, if I want to provide the user with a way to reset the
> form to the initial values which were populated from the database.
It sounds like you will be providing a button for this choice. If so, then
wire it up to a Struts action which will get the values from the database.
Or if those values are cached in application scope, just retrieve those
again.
Paul
Re: S2 Tag Properties
Posted by st...@gmail.com.
Thanks brother! That is what I was looking for.
Scott
On 4/24/07, Musachy Barroso <mu...@gmail.com> wrote:
>
> If the name is null, and there is a key, it will be used as the name. So,
> no, you don't need to duplicate it.
>
> musachy
>
> On 4/24/07, Harring Figueiredo <ha...@gmail.com> wrote:
> >
> > They can the different and serve different purposes.
> >
> > The name attribute that you have there means that the value will be
> picked
> > from
> >
> > yourAction.getUser().getZip().getCity();
> >
> > The key will be used to lookup the resources files using the literal
> > string
> > 'user.zip.city', of course.
> >
> > Hope this helps.
> >
> > Harring.
> >
> > On 4/24/07, stanlick@gmail.com <st...@gmail.com> wrote:
> > >
> > > I notice key is now preferred over getText() and am now curious about
> > > something else. Is the name attribute necessary when using key? I
> > would
> > > rather not duplicate myself unless S2 requires it.
> > >
> > > <s:textfield name="user.zip.city" key="user.zip.city"
> > > size="40"
> > > readonly="true" />
> > >
> > > --
> > > Scott
> > > stanlick@gmail.com
> > >
> >
>
>
>
> --
> "Hey you! Would you help me to carry the stone?" Pink Floyd
>
--
Scott
stanlick@gmail.com
Reset struts form values: Struts 1.3
Posted by "Chaudhary, Harsh" <HC...@amfam.com>.
Hi,
I am using Struts 1.3. We have several struts forms which are
pre-populated from a database.
My questions is, if I want to provide the user with a way to reset the
form to the initial values which were populated from the database. Is
there any API or method calls for that. Or maybe some kind of caching
mechanism or using Apache's beanutils.
Harsh.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: S2 Tag Properties
Posted by Musachy Barroso <mu...@gmail.com>.
If the name is null, and there is a key, it will be used as the name. So,
no, you don't need to duplicate it.
musachy
On 4/24/07, Harring Figueiredo <ha...@gmail.com> wrote:
>
> They can the different and serve different purposes.
>
> The name attribute that you have there means that the value will be picked
> from
>
> yourAction.getUser().getZip().getCity();
>
> The key will be used to lookup the resources files using the literal
> string
> 'user.zip.city', of course.
>
> Hope this helps.
>
> Harring.
>
> On 4/24/07, stanlick@gmail.com <st...@gmail.com> wrote:
> >
> > I notice key is now preferred over getText() and am now curious about
> > something else. Is the name attribute necessary when using key? I
> would
> > rather not duplicate myself unless S2 requires it.
> >
> > <s:textfield name="user.zip.city" key="user.zip.city"
> > size="40"
> > readonly="true" />
> >
> > --
> > Scott
> > stanlick@gmail.com
> >
>
--
"Hey you! Would you help me to carry the stone?" Pink Floyd
Re: S2 Tag Properties
Posted by Harring Figueiredo <ha...@gmail.com>.
They can the different and serve different purposes.
The name attribute that you have there means that the value will be picked
from
yourAction.getUser().getZip().getCity();
The key will be used to lookup the resources files using the literal string
'user.zip.city', of course.
Hope this helps.
Harring.
On 4/24/07, stanlick@gmail.com <st...@gmail.com> wrote:
>
> I notice key is now preferred over getText() and am now curious about
> something else. Is the name attribute necessary when using key? I would
> rather not duplicate myself unless S2 requires it.
>
> <s:textfield name="user.zip.city" key="user.zip.city"
> size="40"
> readonly="true" />
>
> --
> Scott
> stanlick@gmail.com
>