FYI: A form instance is always created by the ActionServlet/RequestProcessor
before the execute method is called (assuming your struts-config has one
mapped). Hence, the reason why a Form is part of the execute signature in
the Action class and why you are able to cast the Form.

Brandon Goodin

-----Original Message-----
From: Brandon Goodin [mailto:[EMAIL PROTECTED]
Sent: Monday, June 02, 2003 12:55 PM
To: Struts Users Mailing List
Subject: RE: first time action


Something sounds fairly wrong with your design. What you are doing is a
common thing. You shouldn't have to do javascrtipt to accomplish it. Could
you please post your code. It seems that you are confusing the function of
the various classes. For example, "FormBean" and "ActionForm" are two terms
for the same thing. Please post the jsp/Action/and ActionForm classes. I
should be able to determine what you are doing from that.

Brandon Goodin

-----Original Message-----
From: Alawadhi, Mona [mailto:[EMAIL PROTECTED]
Sent: Monday, June 02, 2003 12:41 PM
To: 'Struts Users Mailing List'
Subject: RE: first time action


Brandon,

The values are standard for all.
I've tried including the call for setPageDefaults() in the constructor of
the ActionForm class, but it didn't work. My guess is that the "form" is not
created/passed yet since the 'execute' method comes after the constructor. I
tried to create a FormBean object in the ActionForm constructor, but it
didn't work. it doesn't recognize it.

and, of course, I cannot include the setPageDefaults() in the FormBean
constructor, since the FormBean object gets created every time the Action is
called, so, it brings us back to the same problem.

I'm thinking now to use a form.submit() method in javascript. I am not sure
how to go about that, though, since I do not know javascript.

Can you, or anyone from the group help me? I am to pass one hidden filed
(which is the letter), and two other radio-button parameters from my form to
the Action.

Thank you :o)

Mona <------ JavaScript illiterate.

-----Original Message-----
From: Brandon Goodin [mailto:[EMAIL PROTECTED]
Sent: Monday, June 02, 2003 2:10 PM
To: Struts Users Mailing List
Subject: RE: first time action


I am a little confused. I am not sure where you are getting your default
values from. Are they set as a result of client preferences or are they
standard for everyone.

If they are standard for all, it might be best to define the default values
for your ActionForm within the constructor of the ActionForm. That way upon
first entry to the page you have the default values set in the ActionForm.
After that any form values submitted will be set using the get/set of the
ActionForm and replace the defaults.

If, on the other hand, the default values are set via a dynamic process. You
might consider writting two Actions that use the same ActionForm to
accomplish this. Or you could do what I do and use the
LookupDispatchAction/DispatchAction's uspecified method upon entry and
another method of your choosing when submitting the updated form values.

Brandon Goodin


-----Original Message-----
From: Alawadhi, Mona [mailto:[EMAIL PROTECTED]
Sent: Monday, June 02, 2003 11:52 AM
To: 'Struts Users Mailing List'
Subject: RE: first time action


Hello Brandon,

I call "SetPageDefaults" the first time my page loads.
In my JSP, there are links for the Action :
<href="ActionClass.do?parameter="A"> so, the action gets called again and
again. Also, I have different radio buttons along the page to be selected
(the defaults are set for those buttons when the page loads first).

The problem is that when I click on that link, it re-loads the page, and
sets the defaults again. It does not take the new values for the radio
buttons(I have three parms in my page). Therefore, I thought there would be
some kind of indication whether the page is loading first, in order to
include the call for "setPageDefaults" in an if statement and keep my
selections when I call the Action again.

My Page looks something like this:
____________________________________________________________________________
___________________________

Select display:   o By Contact  o By Taxpayer

Type:  o All   o Billing   o Business   o Contact   o Delivery   o Mailing

----------------------------------------------------------------------------
----

  A   B   C   D   E   F   G   H   I   J   K   L   M   N   O   P   Q   R   S
T   U   V   W   X   Y   Z

results (when letter A is chosen):

Anderson, K.
Arizona, B.
... etc
____________________________________________________________________________
___________________________

The user can select two values from the two radio buttons, and a letter,
which is the param passed in <href>.

How would I go about passing those three values to the Action class?

Mona

-----Original Message-----
From: Brandon Goodin [mailto:[EMAIL PROTECTED]
Sent: Monday, June 02, 2003 1:42 PM
To: Struts Users Mailing List
Subject: RE: first time action


It would be good to provide a more clear use case. Usually you don't have
any methods in your ActionForm than the usual getter/setters, validate and
reset. So, I'm not sure what you are asking. Please, be more specific about
what you are trying to accomplish.

Brandon Goodin

-----Original Message-----
From: Alawadhi, Mona [mailto:[EMAIL PROTECTED]
Sent: Monday, June 02, 2003 11:19 AM
To: 'Struts Users Mailing List'
Subject: first time action


Hello Everyone,

I have some methods in my FormBean that I would want to call only the first
time I go through the Action class (load the page).


Any ideas?
Mona


****************************************************************************
*
The information in this email is confidential and may be legally privileged.
It is intended solely for the addressee. Access to this email by anyone else
is unauthorized.

If you are not the intended recipient, any disclosure, copying, distribution
or any action taken or omitted to be taken in reliance on it, is prohibited
and may be unlawful. When addressed to our clients any opinions or advice
contained in this email are subject to the terms and conditions expressed in
the governing KPMG client engagement letter.
****************************************************************************
*


---------------------------------------------------------------------
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]


****************************************************************************
*
The information in this email is confidential and may be legally privileged.
It is intended solely for the addressee. Access to this email by anyone else
is unauthorized.

If you are not the intended recipient, any disclosure, copying, distribution
or any action taken or omitted to be taken in reliance on it, is prohibited
and may be unlawful. When addressed to our clients any opinions or advice
contained in this email are subject to the terms and conditions expressed in
the governing KPMG client engagement letter.
****************************************************************************
*


---------------------------------------------------------------------
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]


****************************************************************************
*
The information in this email is confidential and may be legally privileged.
It is intended solely for the addressee. Access to this email by anyone else
is unauthorized.

If you are not the intended recipient, any disclosure, copying, distribution
or any action taken or omitted to be taken in reliance on it, is prohibited
and may be unlawful. When addressed to our clients any opinions or advice
contained in this email are subject to the terms and conditions expressed in
the governing KPMG client engagement letter.
****************************************************************************
*


---------------------------------------------------------------------
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]

Reply via email to