Re: [OT]What is the best method to set default values of a form?

2003-02-23 Thread Geeta Ramani
Hmm.. maybe I missed something but last I checked poking fun at our president
was quintessentially American.. :)
Geeta

"Michael C. Lee Jr." wrote:

> Once again, leave your anti-American political bullshit off the struts email
> list please.
> Michael Lee
>
> - Original Message -
> From: "James Childers" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Sent: Saturday, February 22, 2003 10:45 AM
> Subject: RE: What is the best method to set default values of a form?
>
> > -Original Message-
> > From: Zsolt Koppany [mailto:[EMAIL PROTECTED]
> > Sent: Saturday, February 22, 2003 4:39 AM
> > To: struts mail list
> > Subject: What is the best method to set default values of a form?
> >
> > I understand that the reset method should not be used to set
> > the default
> > values of the fields of a form. What is the preferred way?
> >
> > --
> > Zsolt
> >
>
> I don't know about "best way", but I usually set the default values in the
> field's declaration:
>
> public final class MakeACallForm extends ActionForm {
>
> private String name = "George 'I Like War!' Bush";
> private String telephoneNumber = "1-800-DA-WHITE-HOUSE";
> ... etc ...
>
> ... getters and setters for above ...
>
> }
>
> -= J
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.456 / Virus Database: 256 - Release Date: 2/18/2003
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [OT]What is the best method to set default values of a form?

2003-02-22 Thread Michael C. Lee Jr.
Once again, leave your anti-American political bullshit off the struts email
list please.
Michael Lee

- Original Message -
From: "James Childers" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Saturday, February 22, 2003 10:45 AM
Subject: RE: What is the best method to set default values of a form?


> -Original Message-
> From: Zsolt Koppany [mailto:[EMAIL PROTECTED]
> Sent: Saturday, February 22, 2003 4:39 AM
> To: struts mail list
> Subject: What is the best method to set default values of a form?
>
> I understand that the reset method should not be used to set
> the default
> values of the fields of a form. What is the preferred way?
>
> --
> Zsolt
>

I don't know about "best way", but I usually set the default values in the
field's declaration:

public final class MakeACallForm extends ActionForm {

private String name = "George 'I Like War!' Bush";
private String telephoneNumber = "1-800-DA-WHITE-HOUSE";
... etc ...

... getters and setters for above ...

}

-= J

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.456 / Virus Database: 256 - Release Date: 2/18/2003

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: What is the best method to set default values of a form?

2003-02-22 Thread Rick Reumann
On Sat, Feb 22,'03 (11:38 AM GMT+0100), Zsolt wrote: 
 
> I understand that the reset method should not be used to set the
> default values of the fields of a form. What is the preferred way?

I think it's best to populate the default form information in an
ActionClass. So if I had an insertEmployee operation that required the
user entering in the information but I wanted prepopulate a lot of the
fields I'd have a link that first called a SetupEmployeeFormAction
and would then forward to the jsp page for the user to enter the
information.

It gets a bit tricky when validation is involved and you are using
request scope, but when you cross that bridge I like Robert Taylor's
solution the best:



"Rick, I usually define the setUpForm action URI as the input attribute
of the processForm action element. That way if a validation error occurs
the request is forwarded to the setUpForm action which repopulates the
list and forwards to the page where my list is displayed along with the
error message and the users input.

Works for me and I don't have to place anything in the session."



-- 
Rick

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: What is the best method to set default values of a form?

2003-02-22 Thread Ray Madigan
If you look at the example that ships with struts you will see how
the registration form is filled in with the data from the User record.
The data isn't from a database, but an inmemory XML datastore.

-Original Message-
From: Jeff Kyser [mailto:[EMAIL PROTECTED]
Sent: Saturday, February 22, 2003 6:36 AM
To: Struts Users Mailing List
Subject: Re: What is the best method to set default values of a form?


For Dyna forms, you can use the initial='',
and on a regular form, for things like radio buttons, the default
value is based on the underlying form bean's value.

http://husted.com/struts/tips/016.html

but not sure about html:text fields in regular ActionForms...

-jeff

On Saturday, February 22, 2003, at 04:38  AM, Zsolt Koppany wrote:

> Hi,
>
> I understand that the reset method should not be used to set the 
> default
> values of the fields of a form. What is the preferred way?
>
> -- 
> Zsolt
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: What is the best method to set default values of a form?

2003-02-22 Thread Zsolt Koppany
Sorry, but I have to read the data from the database.

Zsolt


On Sat, 2003-02-22 at 16:45, James Childers wrote:
> > -Original Message-
> > From: Zsolt Koppany [mailto:[EMAIL PROTECTED]
> > Sent: Saturday, February 22, 2003 4:39 AM
> > To: struts mail list
> > Subject: What is the best method to set default values of a form?
> > 
> > I understand that the reset method should not be used to set 
> > the default
> > values of the fields of a form. What is the preferred way?
> > 
> > -- 
> > Zsolt
> > 
> 
> I don't know about "best way", but I usually set the default values in the field's 
> declaration:
> 
> public final class MakeACallForm extends ActionForm {
> 
>   private String name = "George 'I Like War!' Bush";
>   private String telephoneNumber = "1-800-DA-WHITE-HOUSE";
>   ... etc ...
> 
>   ... getters and setters for above ...
> 
> }
> 
> -= J
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
-- 
Zsolt


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: What is the best method to set default values of a form?

2003-02-22 Thread James Childers
> -Original Message-
> From: Zsolt Koppany [mailto:[EMAIL PROTECTED]
> Sent: Saturday, February 22, 2003 4:39 AM
> To: struts mail list
> Subject: What is the best method to set default values of a form?
> 
> I understand that the reset method should not be used to set 
> the default
> values of the fields of a form. What is the preferred way?
> 
> -- 
> Zsolt
> 

I don't know about "best way", but I usually set the default values in the field's 
declaration:

public final class MakeACallForm extends ActionForm {

private String name = "George 'I Like War!' Bush";
private String telephoneNumber = "1-800-DA-WHITE-HOUSE";
... etc ...

... getters and setters for above ...

}

-= J

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: What is the best method to set default values of a form?

2003-02-22 Thread Jeff Kyser
For Dyna forms, you can use the initial='',
and on a regular form, for things like radio buttons, the default
value is based on the underlying form bean's value.
	http://husted.com/struts/tips/016.html

but not sure about html:text fields in regular ActionForms...

-jeff

On Saturday, February 22, 2003, at 04:38  AM, Zsolt Koppany wrote:

Hi,

I understand that the reset method should not be used to set the 
default
values of the fields of a form. What is the preferred way?

--
Zsolt
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


What is the best method to set default values of a form?

2003-02-22 Thread Zsolt Koppany
Hi,

I understand that the reset method should not be used to set the default
values of the fields of a form. What is the preferred way?

-- 
Zsolt


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]