• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Using Links for submitting forms
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >Using Links for submitting forms (From: Kevin Windham <email@hidden>)
 >Re: Using Links for submitting forms (From: Miguel Arroz <email@hidden>)
 >Re: Using Links for submitting forms (From: Kevin Windham <email@hidden>)

  • Prev by Date: Re: WebObjects 5.3.3, DST and J2SE 1.4.2
  • Next by Date: Re: Making a WO Project dependent on a WO Framework Project
  • Previous by thread: Re: Using Links for submitting forms
  • Next by thread: Re: Using Links for submitting forms
  • Index(es):
    • Date
    • Thread