• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Java Script and S:URL in Struts2

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
cheers everyone

Very Simple Question

I wrote the following java script code. I am not sure whether it will work or not

<script>
function deleteUser(url) {
var msg = confirm("Do you really want to delete the given selected user ?")
if (msg) {window.location.href = site}
else (null)
}
</script>



I have a piece of code which I wanna use

<s:url id="deleteUrl" action="deleteUser" namespace="user">
<s aram name="user.userID" value="userID" />
</s:url>
<s:a href="%{deleteUrl}">
<s:text name="Delete" />
</s:a></td>

But before calling the action deleteUser I want to use a confirmation message something like using the above java script. Which will promt to the user does he really want to delete the user and then I can call the deleteUser Struts action.

Please help me on that or suggest me how should I do it. It might be easier for you but not for me.

If possible post a sample code where somebody has done something like this.

Thanks everybody for reading this post.
reply
    Bookmark Topic Watch Topic
  • New Topic