• 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

Struts action class call from java script

 
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am trying to call javascipt function to for the pop up to confirm to delet or not basically delete link is there and then need to call action class from java script.

Can anyone give me advice?

Thanks,
 
Sheriff
Posts: 9707
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Use Ajax if you don't want the page to be submitted otherwise you can also submit a form using javascript...
 
Ranch Hand
Posts: 544
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
May be you can use Confirm dialog box that JavaScript provides to know user response like "Ok" or "Cancel".

Please see this link.


Of course if you still need to open a new browser window and then use some action to display "Ok, Cancel" buttons, you can do that using window.open() and passing the correct action URL as parameter. But unless specifically needed that would be too much for this kind of scenario.

Regards,
Amit

 
jaisai vijay
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Thanks for your reply.

When we click ok on pop up after that we need call the action.

Could you please give me the solution for this?

Thanks,
Bachi
 
Ankit Garg
Sheriff
Posts: 9707
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dummu Bachi please check your private messages for some administrative matter...
 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can use the Struts URL tag.


then use the



 
jaisai vijay
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Sorry to ask you like this where can I find struts url tag?

I am new to struts that is why I am asking like this.

Thanks,
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What do you mean by "where can I find it"?

Which version of Struts are you using?
 
jaisai vijay
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using struts 1.2.

"where can I find it"?
I mean the uri to include in the JSP page.
 
jaisai vijay
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

Thanks for your help. I am doing in the following way

function delete(num){

val confirmMessage = confirm("Do you want to delete ?");
if(confirmMessage){
document.form[0].action="/projectName/action.do?do=methodName&id="+num;
document.form[0].submi();
}
}

onclick="javascript:delete(1)"

 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic