You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Seshagiri V <se...@kensium.com> on 2009/01/27 12:24:24 UTC

How to convert struts's url to javascript of jQuery.(such as onClick etc events)

Hi All,

Imported jQuery of js file. It is working fine. But how to work onClick
event with parameters  in sturts2.0.

 

Please send me sample code.

 

 

Here is a snippet of my code in the jsp:

 

<s:url id="tempMilestoneRemoveURL" namespace="/u" action="viewConfirm">

            <s:param name="messageConfirm"><s:text
name="milestone_confirm_remove">

            <s:param name="milestoneDTO.name" value="%{milestoneDTO.name}"
/>

            <s:param name="milestoneDTO.dividedPoP.name"
value="%{milestoneDTO.dividedPoP.name}" />

            </s:text>

            </s:param>

            <s:param name="yesURL"><s:url namespace="/p"
action="removeMilestone">

            <s:param name="{milestoneDTO.milestoneid"
value="%{{milestoneDTO.milestoneid}" /></s:url></s:param>

            <s:param name="noURL">

            <s:url namespace="/p" action="viewEditMilestone" />

            </s:param>

</s:url>

 

<s:a href="%{tempMilestoneRemoveURL}"
style="text-decoration:none"><button><s:text name="Delete" /></button></s:a>

 

Please convert above code JavaScript of jQuery ..........

Please use with onClick event in  button tag...................... 

 

 

 

Thank you,

Seshagiri V

seshagiriv@kensium.com. 

 

US Main: 877 KENSIUM (536.7486)

US Fax:   312.242.3029

 

Kensium

200 S Wacker Dr, Suite 3100

Chicago, IL 60606

 

Confidentiality Note:

-----------------------------

The information contained in this e-mail is strictly confidential and for
the intended use of the addressee only. Any disclosure, use or copying of
the information by anyone other than the intended recipient is prohibited.

If you have received this message in error, please notify the sender
immediately by return e-mail and securely discard this message.


Re: How to convert struts's url to javascript of jQuery.(such as onClick etc events)

Posted by dusty <du...@yahoo.com>.
Are those nested s:url tags?  impressive.  

$(document).ready(function(){
      $("#reallyLongLink").click(function(){
               //and to integrate with Struts2
               alert('<s:property value="#tempMilestoneRemoveURL"/>');
      });
});


newton.dave wrote:
> 
> Seshagiri V wrote:
>> Sorry,
>> Required :-
>>  Some example of code in jQuery with events likes as
>> onClick...........struts2.0............................
> 
> That's a lot of periods.
> 
> It's still not clear what you want. In your first message you included a 
> bunch of code and asked for a conversion to jQuery, but there was no 
> JavaScript in the code that could be converted.
> 
> You said you wanted the conversion to use the "onclick" event in the 
> button tag, but didn't give any indication of what you wanted it to do.
> 
> So far I'm not even sure this is a Struts question.
> 
> Dave
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-convert-struts%27s-url-to-javascript-of-jQuery.%28such-as-onClick-etc-events%29-tp21683623p21699990.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: How to convert struts's url to javascript of jQuery.(such as onClick etc events)

Posted by Dave Newton <ne...@yahoo.com>.
Seshagiri V wrote:
> Sorry,
> Required :-
>  Some example of code in jQuery with events likes as
> onClick...........struts2.0............................

That's a lot of periods.

It's still not clear what you want. In your first message you included a 
bunch of code and asked for a conversion to jQuery, but there was no 
JavaScript in the code that could be converted.

You said you wanted the conversion to use the "onclick" event in the 
button tag, but didn't give any indication of what you wanted it to do.

So far I'm not even sure this is a Struts question.

Dave


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


RE: How to convert struts's url to javascript of jQuery.(such as onClick etc events)

Posted by Seshagiri V <se...@kensium.com>.
Sorry,
Required :-
 Some example of code in jQuery with events likes as
onClick...........struts2.0............................


Thank you,
Seshagiri V
seshagiriv@kensium.com. 
 
US Main: 877 KENSIUM (536.7486)
US Fax:   312.242.3029
 
Kensium
200 S Wacker Dr, Suite 3100
Chicago, IL 60606
 
Confidentiality Note:
-----------------------------
The information contained in this e-mail is strictly confidential and for
the intended use of the addressee only. Any disclosure, use or copying of
the information by anyone other than the intended recipient is prohibited.
If you have received this message in error, please notify the sender
immediately by return e-mail and securely discard this message.
 
 
-----Original Message-----
From: Nils-Helge Garli Hegvik [mailto:nilsga@gmail.com] 
Sent: Tuesday, January 27, 2009 5:12 PM
To: Struts Users Mailing List
Subject: Re: How to convert struts's url to javascript of jQuery.(such as
onClick etc events)

It's not exactly clear what you're asking.... If you want to use the
url in a javascript, then just assign the generated output to a
javascript variable:

function myFunc() {
  var jsVariable = '<customtag:someTagThatOutputSomething/>';
  // Do something with jsVariable
  functionThatUsesJsVariable(jsVariable);
}

If that's not what you're looking for, please be more specifi.

Nils-H

On Tue, Jan 27, 2009 at 12:24 PM, Seshagiri V <se...@kensium.com>
wrote:
> Hi All,
>
> Imported jQuery of js file. It is working fine. But how to work onClick
> event with parameters  in sturts2.0.
>
>
>
> Please send me sample code.
>
>
>
>
>
> Here is a snippet of my code in the jsp:
>
>
>
> <s:url id="tempMilestoneRemoveURL" namespace="/u" action="viewConfirm">
>
>            <s:param name="messageConfirm"><s:text
> name="milestone_confirm_remove">
>
>            <s:param name="milestoneDTO.name" value="%{milestoneDTO.name}"
> />
>
>            <s:param name="milestoneDTO.dividedPoP.name"
> value="%{milestoneDTO.dividedPoP.name}" />
>
>            </s:text>
>
>            </s:param>
>
>            <s:param name="yesURL"><s:url namespace="/p"
> action="removeMilestone">
>
>            <s:param name="{milestoneDTO.milestoneid"
> value="%{{milestoneDTO.milestoneid}" /></s:url></s:param>
>
>            <s:param name="noURL">
>
>            <s:url namespace="/p" action="viewEditMilestone" />
>
>            </s:param>
>
> </s:url>
>
>
>
> <s:a href="%{tempMilestoneRemoveURL}"
> style="text-decoration:none"><button><s:text name="Delete"
/></button></s:a>
>
>
>
> Please convert above code JavaScript of jQuery ..........
>
> Please use with onClick event in  button tag......................
>
>
>
>
>
>
>
> Thank you,
>
> Seshagiri V
>
> seshagiriv@kensium.com.
>
>
>
> US Main: 877 KENSIUM (536.7486)
>
> US Fax:   312.242.3029
>
>
>
> Kensium
>
> 200 S Wacker Dr, Suite 3100
>
> Chicago, IL 60606
>
>
>
> Confidentiality Note:
>
> -----------------------------
>
> The information contained in this e-mail is strictly confidential and for
> the intended use of the addressee only. Any disclosure, use or copying of
> the information by anyone other than the intended recipient is prohibited.
>
> If you have received this message in error, please notify the sender
> immediately by return e-mail and securely discard this message.
>
>

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

Internal Virus Database is out of date.
Checked by AVG - http://www.avg.com 
Version: 8.0.176 / Virus Database: 270.10.0/1862 - Release Date: 12/23/2008
12:08 PM


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


Re: How to convert struts's url to javascript of jQuery.(such as onClick etc events)

Posted by Nils-Helge Garli Hegvik <ni...@gmail.com>.
It's not exactly clear what you're asking.... If you want to use the
url in a javascript, then just assign the generated output to a
javascript variable:

function myFunc() {
  var jsVariable = '<customtag:someTagThatOutputSomething/>';
  // Do something with jsVariable
  functionThatUsesJsVariable(jsVariable);
}

If that's not what you're looking for, please be more specifi.

Nils-H

On Tue, Jan 27, 2009 at 12:24 PM, Seshagiri V <se...@kensium.com> wrote:
> Hi All,
>
> Imported jQuery of js file. It is working fine. But how to work onClick
> event with parameters  in sturts2.0.
>
>
>
> Please send me sample code.
>
>
>
>
>
> Here is a snippet of my code in the jsp:
>
>
>
> <s:url id="tempMilestoneRemoveURL" namespace="/u" action="viewConfirm">
>
>            <s:param name="messageConfirm"><s:text
> name="milestone_confirm_remove">
>
>            <s:param name="milestoneDTO.name" value="%{milestoneDTO.name}"
> />
>
>            <s:param name="milestoneDTO.dividedPoP.name"
> value="%{milestoneDTO.dividedPoP.name}" />
>
>            </s:text>
>
>            </s:param>
>
>            <s:param name="yesURL"><s:url namespace="/p"
> action="removeMilestone">
>
>            <s:param name="{milestoneDTO.milestoneid"
> value="%{{milestoneDTO.milestoneid}" /></s:url></s:param>
>
>            <s:param name="noURL">
>
>            <s:url namespace="/p" action="viewEditMilestone" />
>
>            </s:param>
>
> </s:url>
>
>
>
> <s:a href="%{tempMilestoneRemoveURL}"
> style="text-decoration:none"><button><s:text name="Delete" /></button></s:a>
>
>
>
> Please convert above code JavaScript of jQuery ..........
>
> Please use with onClick event in  button tag......................
>
>
>
>
>
>
>
> Thank you,
>
> Seshagiri V
>
> seshagiriv@kensium.com.
>
>
>
> US Main: 877 KENSIUM (536.7486)
>
> US Fax:   312.242.3029
>
>
>
> Kensium
>
> 200 S Wacker Dr, Suite 3100
>
> Chicago, IL 60606
>
>
>
> Confidentiality Note:
>
> -----------------------------
>
> The information contained in this e-mail is strictly confidential and for
> the intended use of the addressee only. Any disclosure, use or copying of
> the information by anyone other than the intended recipient is prohibited.
>
> If you have received this message in error, please notify the sender
> immediately by return e-mail and securely discard this message.
>
>

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