struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alvarado, Juan (c)" <Juan.Alvar...@NielsenMedia.com>
Subject RE: LookupDispatchAction
Date Wed, 15 Jan 2003 19:55:33 GMT
You send a parameter which is configured in struts-config.xml (I'm sure you
knew that) and make sure the value of that parameter matches with one of the
values of the map in getKeyMethodMap(). That should call the desired method
for you.


Ex:

/**
	 * Implementation of getKeyMethodMap
	 */
	protected Map getKeyMethodMap(){
		
		Map map = new HashMap();
		map.put("button.add.record", "addRecord");
				
		return map;	
	}

In your properties file you will have a key:
button.add.record=Add Record

When you submit the form, you make sure that the value of the parameter you
configured in struts-config.xml for that action has a value of 'Add Record'.
The framework will do a reverse lookup on that value of the parameter and
know that it belongs to the key button.add.record and it will know that for
that key it has to call the addRecord method.

Let me know how it goes...

-----Original Message-----
From: Pat Quinn [mailto:pat_quinn2009@hotmail.com]
Sent: Wednesday, January 15, 2003 2:46 PM
To: struts-user@jakarta.apache.org
Subject: RE: LookupDispatchAction


Ok so how do i map the href submit to its relevant method in
getKeyMethodMap(). I send a paramter and map it in this method???






>From: "Alvarado, Juan (c)" <Juan.Alvarado@NielsenMedia.com>
>Reply-To: "Struts Users Mailing List" <struts-user@jakarta.apache.org>
>To: "'Struts Users Mailing List'" <struts-user@jakarta.apache.org>
>Subject: RE: LookupDispatchAction
>Date: Wed, 15 Jan 2003 14:38:50 -0500
>
>The only way I can think of submitting a form without actually having the
>user click on a submit button is to have some type of javascript on the
>page.
>
>You can avoid the scriptlets with jstl I'm pretty sure.
>
>-----Original Message-----
>From: Pat Quinn [mailto:pat_quinn2009@hotmail.com]
>Sent: Wednesday, January 15, 2003 2:32 PM
>To: struts-user@jakarta.apache.org
>Subject: RE: LookupDispatchAction
>
>
>I'm also using the lookupDispatch action... is it possible to use HREF to
>submit a form using this approach... if so whats the cleanest way to do it
>please.... personally i try to avoid javascript and scriptlet code in my
>jsp's
>
>Any ideas guys????
>
>
>
>
>
>
> >From: "Alvarado, Juan (c)" <Juan.Alvarado@NielsenMedia.com>
> >Reply-To: "Struts Users Mailing List" <struts-user@jakarta.apache.org>
> >To: "'Struts Users Mailing List'" <struts-user@jakarta.apache.org>
> >Subject: RE: LookupDispatchAction
> >Date: Wed, 15 Jan 2003 12:01:50 -0500
> >
> >This is something I have done from an onchange event in my forms:
> >
> >function loadCompanyInfoByContract(objForm){
> >
> >	objForm.userAction.value = "<bean:message
> >key='prompt.load.contracts'/>";
> >	objForm.action = "<%= request.getContextPath()
> >%>/selectContractForOrder.do?userAction="+objForm.userAction.value;
> >	objForm.submit();
> >
> >}
> >
> >Let me know if that helps.
> >
> >
> >-----Original Message-----
> >From: Cook, Graham [mailto:graham.cook@cgey.com]
> >Sent: Wednesday, January 15, 2003 11:09 AM
> >To: 'struts-user@jakarta.apache.org'
> >Subject: LookupDispatchAction
> >
> >
> >Hi
> >
> >Is there anyway to use LookupDispatchAction with onChange events on the
> >JSP.
> >Basically, I want to call my LookupDispatchAction (when a user changes a
> >HTML field) and return either an error, or update one of the fields in 
>the
> >form bean.  In my config file I have a parameter defined as doaction and
> >all
> >the HTML buttons call the LookupDispatchAction okay.
> >
> >Im only having a problem when simulating the doaction field through
> >JavaScript. Ideally, I would like to do this with no JavaScript but I 
>dont
> >think thats going to be possible.? Any thoughts
> >
> >
>
>***************************************************************************
>*
> >****************
> >" This message contains information that may be privileged or 
>confidential
> >and
> >is the property of the Cap Gemini Ernst & Young Group. It is intended 
>only
> >for
> >the person to whom it is addressed. If you are not the intended 
>recipient,
> >you
> >are not authorized to read, print, retain, copy, disseminate, distribute,
> >or
> >use
> >this message or any part thereof. If you receive this message in error,
> >please
> >notify the sender immediately and delete all copies of this message ".
>
>***************************************************************************
>*
> >****************
> >
> >
> >--
> >To unsubscribe, e-mail:
> ><mailto:struts-user-unsubscribe@jakarta.apache.org>
> >For additional commands, e-mail:
> ><mailto:struts-user-help@jakarta.apache.org>
> >
> >
> >
> >
> >--
> >To unsubscribe, e-mail:
> ><mailto:struts-user-unsubscribe@jakarta.apache.org>
> >For additional commands, e-mail:
> ><mailto:struts-user-help@jakarta.apache.org>
>
>
>_________________________________________________________________
>Protect your PC - get McAfee.com VirusScan Online
>http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
>
>
>--
>To unsubscribe, e-mail:
><mailto:struts-user-unsubscribe@jakarta.apache.org>
>For additional commands, e-mail:
><mailto:struts-user-help@jakarta.apache.org>
>
>
>
>
>--
>To unsubscribe, e-mail:   
><mailto:struts-user-unsubscribe@jakarta.apache.org>
>For additional commands, e-mail: 
><mailto:struts-user-help@jakarta.apache.org>


_________________________________________________________________
The new MSN 8 is here: Try it free* for 2 months 
http://join.msn.com/?page=dept/dialup


--
To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:struts-user-help@jakarta.apache.org>




--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message