aspose file tools*
The moose likes Struts and the fly likes Struts - Ajax - Popup window question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts - Ajax - Popup window question" Watch "Struts - Ajax - Popup window question" New topic
Author

Struts - Ajax - Popup window question

Nakata kokuyo
Ranch Hand

Joined: Apr 13, 2005
Posts: 439
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

Joined: Apr 13, 2005
Posts: 439
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

Joined: Apr 13, 2005
Posts: 439
anyone have idea on this ?
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
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 ]

Merrill
Consultant, Sima Solutions
Nakata kokuyo
Ranch Hand

Joined: Apr 13, 2005
Posts: 439
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

Joined: Feb 15, 2005
Posts: 4864
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

Joined: Apr 13, 2005
Posts: 439
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
 
Don't get me started about those stupid light bulbs.
 
subject: Struts - Ajax - Popup window question