You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Yosi (JIRA)" <ji...@apache.org> on 2009/01/27 15:14:59 UTC

[jira] Created: (WICKET-2053) Can't close modal panel inside modal page.

Can't close modal panel inside modal page.
------------------------------------------

                 Key: WICKET-2053
                 URL: https://issues.apache.org/jira/browse/WICKET-2053
             Project: Wicket
          Issue Type: Bug
          Components: wicket-extensions
    Affects Versions: 1.4-RC1, 1.3.5
            Reporter: Yosi


I have ModalWindow showing a page containing anothor (child) ModalWindow showing a panel.

When trying to close the inner panel ModalWindow wicket is trying to close the parent ModalWindow (page).

I found the error in modal.js:
---------------------------------------------------

Wicket.Window.close = function() {
	
	var win;
	try {		
		win = window.parent.Wicket.Window;
	} catch (ignore) {		
	}
	
	if (typeof(win) != "undefined" && typeof(win.current) != "undefined") {
		// we can't call close directly, because it will delete our window,
		// so we will schedule it as timeout for parent's window
		window.parent.setTimeout(function() {
			win.current.close();			
		}, 0);
	}
}



the following code seem to fix it:
---------------------------------------------------

Wicket.Window.close = function() {
	var win;
	try {
		win = window.parent.Wicket.Window;
	} catch (ignore) {
	}

	if (typeof(win) == "undefined" || typeof(win.current) == "undefined") {
		try {
			win = window.Wicket.Window;
		} catch (ignore) {
		}
	}

	if (typeof(win) != "undefined" && typeof(win.current) != "undefined") {
		if (win.current.content.tagName.toLowerCase() == 'iframe') {
			var innerWin = win.current.content.contentWindow.Wicket.Window;
			if (innerWin && innerWin.current) {
				win = innerWin;
			}
		}

		var close = function(w) {
			w.setTimeout(function() {
				win.current.close();
			}, 0);
		};
		try {
			close(window.parent);
		} catch (ignore) {
			close(window);
		}
	}
};

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


[jira] Assigned: (WICKET-2053) Can't close modal panel inside modal page.

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-2053?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Vaynberg reassigned WICKET-2053:
-------------------------------------

    Assignee: Matej Knopp

> Can't close modal panel inside modal page.
> ------------------------------------------
>
>                 Key: WICKET-2053
>                 URL: https://issues.apache.org/jira/browse/WICKET-2053
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-extensions
>    Affects Versions: 1.3.5, 1.4-RC1
>            Reporter: Yosi
>            Assignee: Matej Knopp
>
> I have ModalWindow showing a page containing anothor (child) ModalWindow showing a panel.
> When trying to close the inner panel ModalWindow wicket is trying to close the parent ModalWindow (page).
> I found the error in modal.js:
> ---------------------------------------------------
> Wicket.Window.close = function() {
> 	
> 	var win;
> 	try {		
> 		win = window.parent.Wicket.Window;
> 	} catch (ignore) {		
> 	}
> 	
> 	if (typeof(win) != "undefined" && typeof(win.current) != "undefined") {
> 		// we can't call close directly, because it will delete our window,
> 		// so we will schedule it as timeout for parent's window
> 		window.parent.setTimeout(function() {
> 			win.current.close();			
> 		}, 0);
> 	}
> }
> the following code seem to fix it:
> ---------------------------------------------------
> Wicket.Window.close = function() {
> 	var win;
> 	try {
> 		win = window.parent.Wicket.Window;
> 	} catch (ignore) {
> 	}
> 	if (typeof(win) == "undefined" || typeof(win.current) == "undefined") {
> 		try {
> 			win = window.Wicket.Window;
> 		} catch (ignore) {
> 		}
> 	}
> 	if (typeof(win) != "undefined" && typeof(win.current) != "undefined") {
> 		if (win.current.content.tagName.toLowerCase() == 'iframe') {
> 			var innerWin = win.current.content.contentWindow.Wicket.Window;
> 			if (innerWin && innerWin.current) {
> 				win = innerWin;
> 			}
> 		}
> 		var close = function(w) {
> 			w.setTimeout(function() {
> 				win.current.close();
> 			}, 0);
> 		};
> 		try {
> 			close(window.parent);
> 		} catch (ignore) {
> 			close(window);
> 		}
> 	}
> };

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


[jira] Closed: (WICKET-2053) Can't close modal panel inside modal page.

Posted by "Matej Knopp (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-2053?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Matej Knopp closed WICKET-2053.
-------------------------------

    Resolution: Won't Fix

Panel modal window inside iframe modal window is not supported.

> Can't close modal panel inside modal page.
> ------------------------------------------
>
>                 Key: WICKET-2053
>                 URL: https://issues.apache.org/jira/browse/WICKET-2053
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-extensions
>    Affects Versions: 1.3.5, 1.4-RC1
>            Reporter: Yosi
>            Assignee: Matej Knopp
>
> I have ModalWindow showing a page containing anothor (child) ModalWindow showing a panel.
> When trying to close the inner panel ModalWindow wicket is trying to close the parent ModalWindow (page).
> I found the error in modal.js:
> ---------------------------------------------------
> Wicket.Window.close = function() {
> 	
> 	var win;
> 	try {		
> 		win = window.parent.Wicket.Window;
> 	} catch (ignore) {		
> 	}
> 	
> 	if (typeof(win) != "undefined" && typeof(win.current) != "undefined") {
> 		// we can't call close directly, because it will delete our window,
> 		// so we will schedule it as timeout for parent's window
> 		window.parent.setTimeout(function() {
> 			win.current.close();			
> 		}, 0);
> 	}
> }
> the following code seem to fix it:
> ---------------------------------------------------
> Wicket.Window.close = function() {
> 	var win;
> 	try {
> 		win = window.parent.Wicket.Window;
> 	} catch (ignore) {
> 	}
> 	if (typeof(win) == "undefined" || typeof(win.current) == "undefined") {
> 		try {
> 			win = window.Wicket.Window;
> 		} catch (ignore) {
> 		}
> 	}
> 	if (typeof(win) != "undefined" && typeof(win.current) != "undefined") {
> 		if (win.current.content.tagName.toLowerCase() == 'iframe') {
> 			var innerWin = win.current.content.contentWindow.Wicket.Window;
> 			if (innerWin && innerWin.current) {
> 				win = innerWin;
> 			}
> 		}
> 		var close = function(w) {
> 			w.setTimeout(function() {
> 				win.current.close();
> 			}, 0);
> 		};
> 		try {
> 			close(window.parent);
> 		} catch (ignore) {
> 			close(window);
> 		}
> 	}
> };

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


[jira] Commented: (WICKET-2053) Can't close modal panel inside modal page.

Posted by "Martin Makundi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-2053?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12929718#action_12929718 ] 

Martin Makundi commented on WICKET-2053:
----------------------------------------

Hi!

Is here a possible fix+patch for this problem: https://issues.apache.org/jira/browse/WICKET-3151

?


> Can't close modal panel inside modal page.
> ------------------------------------------
>
>                 Key: WICKET-2053
>                 URL: https://issues.apache.org/jira/browse/WICKET-2053
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-extensions
>    Affects Versions: 1.3.5, 1.4-RC1
>            Reporter: Yosi
>            Assignee: Matej Knopp
>
> I have ModalWindow showing a page containing anothor (child) ModalWindow showing a panel.
> When trying to close the inner panel ModalWindow wicket is trying to close the parent ModalWindow (page).
> I found the error in modal.js:
> ---------------------------------------------------
> Wicket.Window.close = function() {
> 	
> 	var win;
> 	try {		
> 		win = window.parent.Wicket.Window;
> 	} catch (ignore) {		
> 	}
> 	
> 	if (typeof(win) != "undefined" && typeof(win.current) != "undefined") {
> 		// we can't call close directly, because it will delete our window,
> 		// so we will schedule it as timeout for parent's window
> 		window.parent.setTimeout(function() {
> 			win.current.close();			
> 		}, 0);
> 	}
> }
> the following code seem to fix it:
> ---------------------------------------------------
> Wicket.Window.close = function() {
> 	var win;
> 	try {
> 		win = window.parent.Wicket.Window;
> 	} catch (ignore) {
> 	}
> 	if (typeof(win) == "undefined" || typeof(win.current) == "undefined") {
> 		try {
> 			win = window.Wicket.Window;
> 		} catch (ignore) {
> 		}
> 	}
> 	if (typeof(win) != "undefined" && typeof(win.current) != "undefined") {
> 		if (win.current.content.tagName.toLowerCase() == 'iframe') {
> 			var innerWin = win.current.content.contentWindow.Wicket.Window;
> 			if (innerWin && innerWin.current) {
> 				win = innerWin;
> 			}
> 		}
> 		var close = function(w) {
> 			w.setTimeout(function() {
> 				win.current.close();
> 			}, 0);
> 		};
> 		try {
> 			close(window.parent);
> 		} catch (ignore) {
> 			close(window);
> 		}
> 	}
> };

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