RE: implementing form actions

2002-05-15 Thread Vikram Goyal01

Also,

Using javascript change the action class based on what button is clicked. So:






fnDoSubmit(btn){

 document.myForm.action = btn.value;
 document.myForm.submit;

}


You might need to put the suffix .do to the action in the javascript or the value of 
the buttons.

Rgs
Vikram

-Original Message-
From: Victor Hadianto [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 16, 2002 5:15 AM
To: Struts Users Mailing List
Subject: Re: implementing form actions


> I currently define a single action, forward
> all the [operation] buttons to the action and let
> the action distinguish between the various operations
> based on a property name.

Another way of doing this is by utilising an "action" property on your form 
bean and for declare a setters method for the buttons to set the action 
properly. For example:


In you form bean:

public class FormBean {

int action;

public setOperation1(String ignore) {
action = ONE;
}

public setOperation2(String ignore) {
action = TWO;
}


}

And assuming your buttons named operation1 and operation2 you can check based 
on the action content which button the user clicks;

HTH,

-- 
Victor Hadianto
---
Don't tell me what you dreamed last night for I've been reading Freud.

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


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




Re: implementing form actions

2002-05-15 Thread Victor Hadianto

> I currently define a single action, forward
> all the [operation] buttons to the action and let
> the action distinguish between the various operations
> based on a property name.

Another way of doing this is by utilising an "action" property on your form 
bean and for declare a setters method for the buttons to set the action 
properly. For example:


In you form bean:

public class FormBean {

int action;

public setOperation1(String ignore) {
action = ONE;
}

public setOperation2(String ignore) {
action = TWO;
}


}

And assuming your buttons named operation1 and operation2 you can check based 
on the action content which button the user clicks;

HTH,

-- 
Victor Hadianto
---
Don't tell me what you dreamed last night for I've been reading Freud.

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




implementing form actions

2002-05-15 Thread K Br

what is the recommended action structure
to implement the following form pattern?

  [data fields]
 [operation1] [operation2]...[operationN]

I currently define a single action, forward
all the [operation] buttons to the action and let
the action distinguish between the various operations
based on a property name. 

is this the only approach
or is there a better approach.

Tx

/Kobe



--
To unsubscribe, e-mail:   
For additional commands, e-mail: