[ 
https://issues.apache.org/jira/browse/WICKET-1003?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12530571
 ] 

Don Hass commented on WICKET-1003:
----------------------------------

I had the similar problem today after getting an updated snapshot.  
Modal Windows (panel based - not page) that I had with a form on it would fail 
to close throwing a JS exception.

My investigation found that the update to wicket-ajax.js is the culprit.  
Revision 579593 to be specific.
/jdk-1.4/wicket/src/main/java/org/apache/wicket/ajax/wicket-ajax.js (revision 
579593)

It appears the update on this morning at Sept 26 at 7:16AM by knopp broke this 
for me at least.  Since if I went back to the previous revision (579172) the 
problem goes away.

Specific code in question is listed below.  Hope this helps save someone else 
some headaches this caused for me this morning.  I guess that is what I get for 
using latest snapshots some times. :)

-    try {
-   // do the evaluation
-     eval(text);
-    } catch (exception) {
-     Wicket.Log.error("Exception evaluating javascript: " + exception);
-    }
-    // continue to next step
- notify();
- });
+    
+    // test if the javascript is in form of identifier|code
+    // if it is, we allow for letting the javascript decide when the rest of 
processing will continue
+    // by invoking identifier();
+    var res = text.match("([a-z|A-Z_][a-z|A-Z|0-9_]*)\\|(.*)");
+    
+    if (res != null) {
+     text = "var f = function(" + res[1] + ") {" + res[2] +"};";    
+     try {
+   // do the evaluation
+     eval(text);
+     f(notify);
+    } catch (exception) {
+     Wicket.Log.error("Exception evaluating javascript: " + exception);
+    }
+    
+    } else {
+     // just evaluate the javascript
+    try {
+   // do the evaluation
+     eval(text);
+    } catch (exception) {
+     Wicket.Log.error("Exception evaluating javascript: " + exception);
+    }
+    // continue to next step
+ notify();
+ }
+ });


> Modal Window Does Not Close When Using IndicatingAjaxButton
> -----------------------------------------------------------
>
>                 Key: WICKET-1003
>                 URL: https://issues.apache.org/jira/browse/WICKET-1003
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-extensions
>    Affects Versions: 1.3.0-beta4
>         Environment: Ubuntu, Jetty, Eclipse
>            Reporter: Carlo M. Camerino
>         Attachments: quickstart-closeDoesntWork.zip
>
>
> I have  a panel in my modal window. I have a button in my panel that closes 
> the modalwindow.
> If I use an indicatingajaxbutton for that button, the modalwindow does not 
> close properly.
> However if i use an ajaxlink, things go smoothly.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to