• 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 - Ajax - Popup window question

 
Ranch Hand
Posts: 472
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi good day to all,

i have a page.jsp, this page have a checkbox, when tick on checkbox, it prompt a popup window and this popup window allow user enter password in order to further proceed, if popup window enter wrong password, it should display error message in popup window, if correct password , it will close the popup window and checkbox ticked

the popup window is construct as follow :



when i enter correct password or incorrect password , it doesn't prompt the error message but does return the whole xml file and replaced the popup window, can i know which part i have done wrong ?

below is part of action


thank you for guidance
[ November 07, 2006: Message edited by: Nakata kokuyo ]
 
Nakata kokuyo
Ranch Hand
Posts: 472
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi all ,
after i change this part


to



i can see that function initRequest() is called but not function properly, may be it doesn't create the Ajax.Request object, i'm not sure on this ..can someone guide me how to further debug ?
 
Nakata kokuyo
Ranch Hand
Posts: 472
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
anyone have idea on this ?
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I haven't used the script.aculo.us Ajax prototype, so I couldn't help you much on this.

I did find this link that might be useful to you. One thing you might try is adding a postBody to your options to set the value of the user name and password. Remember this is an AJAX call, so input fields are not automatically included as parameters. You have to explicitly include them in the URL. Also, if I'm reading the documentation correctly, you should be using onSuccess instead of onComplete.

This isn't really a Struts problem, but a JavaScript problem. You may have better luck finding an answer in a forum that specializes in JavaScript, or ideally one that specializes in script.aculo.us.
[ November 09, 2006: Message edited by: Merrill Higginson ]
 
Nakata kokuyo
Ranch Hand
Posts: 472
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thank you Merrill Higginson for the information,

the code is work if i put it into normal page(at least the function in action is called) but not in popup window page.

i wondering do we call the ajax function in popup window with same way as what we did in normal page ?
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
AJAX doesn't work any differently in a popup window than in a regular window. There has to be some difference in your code or in the environment. I'm wondering if you forgot to include the definition of the script.aculo.us library in the popup window.
 
Nakata kokuyo
Ranch Hand
Posts: 472
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thank you Merrill Higginson for the hints, i really did a stupid and unforgiven mistake where i didn't import the source for js file properly, it solved now
 
reply
    Bookmark Topic Watch Topic
  • New Topic