struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kawczynski, David" <david_kawczyn...@merck.com>
Subject RE: html:link submit with request parameters
Date Mon, 16 Nov 2009 15:38:36 GMT
The code examples pasted confuse me; I don't know what are you 
trying to accomplish.  Please pick one:

1. You have a <form> where the user provides data.  You wish to
   relay that data to a Struts action class.

2. You have data supplied by the server.  You wish to include 
   that data in a hyperlink.

3. You want something else.  In this case, please describe what
   you what you are trying to do (from a user's perspective).  
   You can also include how you are trying to do it.
 

> -----Original Message-----
> From: fea jabi [mailto:zyxrm@hotmail.com] 
> Sent: Saturday, November 14, 2009 4:19 AM
> To: user@struts.apache.org
> Subject: RE: html:link submit with request parameters
> 
> 
> thank you for your responce.
> 
>  
> 
> I tried the below to pass parameters and also to submit the form.
> 
>  
> 
>     
> 
> <jsp:useBean id="mapParams" class="java.util.HashMap"/>
> <c:set target="${mapParams}" property="theKey" value="${theValue}"/>
> <c:set target="${mapParams}" property="theKey1" value="${theValue1}"/>
> 
> 
> <html:link href="javascript:document.myform.submit()" 
> name="mapParams" >
> <c:out value="${custItr.empName}"/>
> </html:link>   
> 
>  
> 
> When i click on the link getting javascript error which says 
> "syntax error". when I remove the "name" attribute in 
> <html:link> there is no error but I need to have the name 
> attribute to pass the parameters. 
> 
> How to do both the submit and passing of parameters using 
> <html:link>? Your help is appreciated.
> 
>  
> 
> Thanks.
>  
> > Subject: RE: html:link submit with request parameters
> > Date: Fri, 13 Nov 2009 14:44:55 -0500
> > From: david_kawczynski@merck.com
> > To: user@struts.apache.org
> > 
> > Use javascript to get a reference to the form, and call its submit 
> > method. 
> > 
> > EG
> > <form name="form" id="form" action="/setup.do">
> > <input name="blah" />
> > <input type="submit"/>
> > </form>
> > <script>
> > function submit() {
> > document.getElementById("form").submit() return false;
> > }
> > </script>
> > <a href="javascript:submit();" 
> > onclick="return submit();">click me</a>
> > 
> > 
> > 
> > 
> > 
> > 
> > > -----Original Message-----
> > > From: fea jabi [mailto:zyxrm@hotmail.com] 
> > > Sent: Thursday, November 12, 2009 8:43 PM
> > > To: user@struts.apache.org
> > > Subject: html:link submit with request parameters
> > > 
> > > 
> > > I need to submit the form when the <html:link ..... > is 
> > > clicked/pressed and also need to pass parameters. 
> > > 
> > > 
> > > 
> > > <c:url value="/setup.do" var="setupUrl">
> > > 
> > > <c:param name="empId" value="${custItr.empId}"/>
> > > 
> > > </c:url>
> > > 
> > > <html:link href="<%= 
> > > (String)pageContext.getAttribute(\"setupUrl\") %>" 
> > > transaction="true" >
> > > 
> > > <c:out value="${custItr.empName}"/>
> > > 
> > > </html:link>
> > > 
> > > 
> > > 
> > > but this is not submitting the form. How can I submit the 
> > > form and also pass the request params? Basically I want other 
> > > values entered in the html form are set to the form bean so i 
> > > can acess those in action class when the link is pressed.
> > > 
> > > 
> > > 
> > > How can this be done?
> > > 
> > > 
> > > 
> > > Thanks.
> > > 
> > > _________________________________________________________________
> > > Hotmail: Trusted email with Microsoft's powerful SPAM protection.
> > > http://clk.atdmt.com/GBL/go/177141664/direct/01/
> > > http://clk.atdmt.com/GBL/go/177141664/direct/01/
> > > 
> > Notice: This e-mail message, together with any attachments, 
> contains information of Merck & Co., Inc. (One Merck Drive, 
> Whitehouse Station, New Jersey, USA 08889), and/or its 
> affiliates Direct contact information for affiliates is 
> available at http://www.merck.com/contact/contacts.html) that 
> may be confidential, proprietary copyrighted and/or legally 
> privileged. It is intended solely for the use of the 
> individual or entity named on this message. If you are not 
> the intended recipient, and have received this message in 
> error, please notify us immediately by reply e-mail and then 
> delete it from your system.
> > 
> > 
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> > 
>  		 	   		  
> _________________________________________________________________
> Windows 7: It works the way you want. Learn more.
> http://www.microsoft.com/Windows/windows-7/default.aspx?ocid=P
ID24727::T:WLMTAGL:ON:WL:en-US:WWL_WIN_evergreen:112009v2
> 
Notice:  This e-mail message, together with any attachments, contains information of Merck
& Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), and/or its affiliates
Direct contact information for affiliates is available at http://www.merck.com/contact/contacts.html)
that may be confidential, proprietary copyrighted and/or legally privileged. It is intended
solely for the use of the individual or entity named on this message. If you are not the intended
recipient, and have received this message in error, please notify us immediately by reply
e-mail and then delete it from your system.


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


Mime
View raw message