Re: Using Links for submitting forms
Re: Using Links for submitting forms
- Subject: Re: Using Links for submitting forms
- From: James Cicenia <email@hidden>
- Date: Mon, 12 Mar 2007 12:58:42 -0500
I use the submit() function with a hidden variable for this purpose:
JAVA:
public String hyperLinkClick="";
public WOComponent doSubmit(){
if("SAVE_AND_SUBMIT".equals(hyperLinkClick)){
return saveAndSubmitChanges();
}else if ("SAVE_CHANGES".equals(hyperLinkClick)){
return saveChanges();
}else if ("CANCEL".equals(hyperLinkClick)){
return cancel();
}else if ("NEXT".equals(hyperLinkClick)){
return next();
}else if ("PREV".equals(hyperLinkClick)){
return prev();
}else
return (WOComponent) context().page();
}
WOD EXAMPLE:
Form1: WOForm {
name = "form1";
action = doSubmit;
multipleSubmit = true;
}
HiddenField1: WOHiddenField {
name = "linkValue";
value = hyperLinkClick;
}
JAVASCRIPT EXAMPLE:
"form1.linkValue.value = 'PREV';form1.submit();return false;"
HTH
James Cicenia
On Mar 12, 2007, at 12:30 PM, Kevin Windham wrote:
On Mar 12, 2007, at 12:00 PM, Miguel Arroz wrote:
Hi!
Use javascript to call the submit() function of the form. Of
course, clients must have JS active.
Yours
Miguel Arroz
Yeah, the key is that there could be multiple buttons. Using submit
() can only call one action which is bound to the form from what I
understand. Correct me if I'm wrong. Is there maybe a way to change
the action of the form with javascript?
Kevin
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40jimijon.com
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden