Re: Problem closing a ModalWindow when used through an IFrame

2007-11-08 Thread Ville Paasimaa
I found a possible fix to this problem. If you leave the
window.parent.setTimeout statement off and just call directly
win.current.close the modal window will be closed.
You can test this by changing getCloseJavacript method of the
ModalWindow.java to return this:

   {
return "var win;\n" //
+ "try {\n"
+ " win = window.parent.Wicket.Window;\n"
+ "} catch (ignore) {\n"
+ "}\n"
+ "if (typeof(win) == \"undefined\" ||
typeof(win.current) == \"undefined\") {\n"
+ "  try {\n"
+ " win = window.Wicket.Window;\n"
+ "  } catch (ignore) {\n"
+ "  }\n"
+ "}\n"
+ "if (typeof(win) != \"undefined\" &&
typeof(win.current) != \"undefined\") {\n"
+ " win.current.close();\n"
+ "}";
}

Matej, what is the purpose of the window.parent.setTimeout in the
original code? Why couldn't the closing be done just simply by calling
win.current.close?

Ville

On Nov 7, 2007 3:00 PM, Ville Paasimaa <[EMAIL PROTECTED]> wrote:
> Have you noticed that if you try to close the example window from OK or
> CANCEL button it closes even when used through an iframe?
>
> By using firebug, you can place breakpoints to modal.js and see that this
> code is executed when the window is closed from OK button:
>
> org/apache/wicket/extensions/ajax/markup/html/modal/res/modal.js
>
> On line 699:
> if (this.isIframe() == true) {
> var current =
> this.content.contentWindow.Wicket.Window.current ;
>
> On line 715
> close: function(force) {
> ... etc
>
> But the above code is not executed when the modal window is closed from the
> X button on upper right corner of the window.
>
> Could it solve the problem if the same close function would be executed from
> the X-button too?
>
>
>
>
>  On Nov 1, 2007 12:14 PM, Deepak Mahavishnu <[EMAIL PROTECTED]> wrote:
> > Hello!
> >
> > I'm doing some POC testing to find out how a wicket application could be
> > used through an IFrame and noticed that closing of a ModalWindow fails.
> >
> > My setup:
> >
> > Application A:
> > -a dummy html page that has an IFrame
> > -the contents of the IFrame is requested from Application B
> > http://localhost:8080/mywicketapp/app/"; width="100%"
> > height="500">
> >
> > Application B:
> > -a Wicket application that uses a ModalWindow
> > -deployed to tomcat:  http://localhost:8080/mywicketapp/
> >
> >
> > Problem:
> > The ModalWindow is not closed when OK ( or Cancel ) button is clicked when
> > Application B is used throug IFrame of Application A.
> > OK button performs the actual action (in my case deletes an item from a
> > list) but is not closed after the execution of the action.
> >
> > Closing of the ModalWindow works normally when Application B is not used
> > through an IFrame.
> >
> > Any suggestions how this could be solved?  Or is the usage through an
> IFrame
> > a bad idea from start?
> >
> > Any help is appreciated!
> >
> > Mahavishnu
> >
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Problem closing a ModalWindow when used through an IFrame

2007-11-07 Thread Ville Paasimaa
Have you noticed that if you try to close the example window from OK or
CANCEL button it closes even when used through an iframe?

By using firebug, you can place breakpoints to modal.js and see that this
code is executed when the window is closed from OK button:

org/apache/wicket/extensions/ajax/markup/html/modal/res/modal.js

On line 699:
if (this.isIframe() == true) {
var current =
this.content.contentWindow.Wicket.Window.current;

On line 715
close: function(force) {
... etc

But the above code is not executed when the modal window is closed from the
X button on upper right corner of the window.

Could it solve the problem if the same close function would be executed from
the X-button too?


On Nov 1, 2007 12:14 PM, Deepak Mahavishnu <[EMAIL PROTECTED]> wrote:

> Hello!
>
> I'm doing some POC testing to find out how a wicket application could be
> used through an IFrame and noticed that closing of a ModalWindow fails.
>
> My setup:
>
> Application A:
> -a dummy html page that has an IFrame
> -the contents of the IFrame is requested from Application B
> http://localhost:8080/mywicketapp/app/"; width="100%"
> height="500">
>
> Application B:
> -a Wicket application that uses a ModalWindow
> -deployed to tomcat:  http://localhost:8080/mywicketapp/
>
>
> Problem:
> The ModalWindow is not closed when OK ( or Cancel ) button is clicked when
> Application B is used throug IFrame of Application A.
> OK button performs the actual action (in my case deletes an item from a
> list) but is not closed after the execution of the action.
>
> Closing of the ModalWindow works normally when Application B is not used
> through an IFrame.
>
> Any suggestions how this could be solved?  Or is the usage through an
> IFrame
> a bad idea from start?
>
> Any help is appreciated!
>
> Mahavishnu
>


Re: Problem closing a ModalWindow when used through an IFrame

2007-11-04 Thread Deepak Mahavishnu
Hi!

2007/11/4, Matej Knopp <[EMAIL PROTECTED]>:
>
> Not yet, and I'm not sure I'm going to soon. Supporing modal window in
> iframe might be too big change for 1.3, because of they way modal
> window internally works.


Ok.

Btw. you example is broken, because you load page from
> wicket-library.com, which is different domain than where the iframe
> is. That will not work at all, since it would be cross-domain
> scripting, which browsers don't allow.


We are studying if we could embed content from a wicket application (Site
A)  to another application (Site B) in different domain using an IFrame. Are
you saying that we absolute should not try to do that?

The IFrame opportunity is studied because Site B does not have a portal
platform nor a WSRP support. And other reason is that the owner of Site B
does not want to code any web UI code related to the application and there
is a business need to have the new features of the wicket application
available on Site B immediately when ever the application is updated. So
this would make anykind of proxying or "remote API" based solutions
difficult.

There would be no need to communicate between the applications, just to
visually embed the wicket application inside one page in site B. As far as
we have tested the Closing of the ModalWindow is the only thing that has not
worked in this setup. Everything else seems to work fine.

We have tought that it would be considered as "cross site scripting" only if
the Wicket Ajax components would try to refer to dom objects of site B. And
we have no intention of doing so intentionally. Could that possibly be the
reason why the ModalWindow does not close when used through an IFrame?
Perhaps it tries to refer to the owner window by using
HTMLdocument.parentor something like that?

We could perhaps change the ModalWindow to something else that works in our
case, and avoid that problem, but would you still say that we absolutely
should not try this kind of setup although rest of the application seems to
work through the IFrame?

I would be very grateful to hear your opinions on this!

DM

-Matej
>
> On 11/4/07, Deepak Mahavishnu <[EMAIL PROTECTED]> wrote:
> > Hi Matej!
> > Have you been able to reproduce this problem?
> > DM
> >
> > 2007/11/1, Deepak Mahavishnu <[EMAIL PROTECTED]>:
> > >
> > > Hi Matej!
> > > And thanks for a quick response!
> > >
> > > I opened a jira issue related to this. The quick start is very
> straight
> > > forward:
> > >
> > > Just create a html page with this source:
> > >
> > > 
> > > 
> > > http://www.wicket-library.com/wicket-examples/ajax/modal-window.1";
> > > width="100%" height="100%">
> > > 
> > > 
> > >
> > > And then open "Show modal dialog with panel" and try to close the
> dialog.
> > >
> > > Mahavishnu
> > >
> > > 2007/11/1, Matej Knopp <[EMAIL PROTECTED]>:
> > > >
> > > > The modal window probably won't work well when paced in a page that
> is
> > > > loaded in iframe. Still, if you can provide a quickstart assigned to
> a
> > > > JIRA entry I will take a look if there is a quick fix for your
> > > > problem.
> > > >
> > > > -Matej
> > > >
> > > > On 11/1/07, Deepak Mahavishnu <[EMAIL PROTECTED]> wrote:
> > > > > Hello!
> > > > >
> > > > > I'm doing some POC testing to find out how a wicket application
> could
> > > > be
> > > > > used through an IFrame and noticed that closing of a ModalWindow
> > > > fails.
> > > > >
> > > > > My setup:
> > > > >
> > > > > Application A:
> > > > > -a dummy html page that has an IFrame
> > > > > -the contents of the IFrame is requested from Application B
> > > > > http://localhost:8080/mywicketapp/app/"; width="100%"
> > > > > height="500">
> > > > >
> > > > > Application B:
> > > > > -a Wicket application that uses a ModalWindow
> > > > > -deployed to tomcat:  http://localhost:8080/mywicketapp/
> > > > >
> > > > >
> > > > > Problem:
> > > > > The ModalWindow is not closed when OK ( or Cancel ) button is
> clicked
> > > > when
> > > > > Application B is used throug IFrame of Application A.
> > > > > OK button performs the actual action (in my case deletes an item
> from
> > > > a
> > > > > list) but is not closed after the execution of the action.
> > > > >
> > > > > Closing of the ModalWindow works normally when Application B is
> not
> > > > used
> > > > > through an IFrame.
> > > > >
> > > > > Any suggestions how this could be solved?  Or is the usage through
> an
> > > > IFrame
> > > > > a bad idea from start?
> > > > >
> > > > > Any help is appreciated!
> > > > >
> > > > > Mahavishnu
> > > > >
> > > >
> > > >
> -
> > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > >
> > > >
> > >
> >
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: Problem closing a ModalWindow when used through an IFrame

2007-11-04 Thread Matej Knopp
Not yet, and I'm not sure I'm going to soon. Supporing modal window in
iframe might be too big change for 1.3, because of they way modal
window internally works.

Btw. you example is broken, because you load page from
wicket-library.com, which is different domain than where the iframe
is. That will not work at all, since it would be cross-domain
scripting, which browsers don't allow.

-Matej

On 11/4/07, Deepak Mahavishnu <[EMAIL PROTECTED]> wrote:
> Hi Matej!
> Have you been able to reproduce this problem?
> DM
>
> 2007/11/1, Deepak Mahavishnu <[EMAIL PROTECTED]>:
> >
> > Hi Matej!
> > And thanks for a quick response!
> >
> > I opened a jira issue related to this. The quick start is very straight
> > forward:
> >
> > Just create a html page with this source:
> >
> > 
> > 
> > http://www.wicket-library.com/wicket-examples/ajax/modal-window.1";
> > width="100%" height="100%">
> > 
> > 
> >
> > And then open "Show modal dialog with panel" and try to close the dialog.
> >
> > Mahavishnu
> >
> > 2007/11/1, Matej Knopp <[EMAIL PROTECTED]>:
> > >
> > > The modal window probably won't work well when paced in a page that is
> > > loaded in iframe. Still, if you can provide a quickstart assigned to a
> > > JIRA entry I will take a look if there is a quick fix for your
> > > problem.
> > >
> > > -Matej
> > >
> > > On 11/1/07, Deepak Mahavishnu <[EMAIL PROTECTED]> wrote:
> > > > Hello!
> > > >
> > > > I'm doing some POC testing to find out how a wicket application could
> > > be
> > > > used through an IFrame and noticed that closing of a ModalWindow
> > > fails.
> > > >
> > > > My setup:
> > > >
> > > > Application A:
> > > > -a dummy html page that has an IFrame
> > > > -the contents of the IFrame is requested from Application B
> > > > http://localhost:8080/mywicketapp/app/"; width="100%"
> > > > height="500">
> > > >
> > > > Application B:
> > > > -a Wicket application that uses a ModalWindow
> > > > -deployed to tomcat:  http://localhost:8080/mywicketapp/
> > > >
> > > >
> > > > Problem:
> > > > The ModalWindow is not closed when OK ( or Cancel ) button is clicked
> > > when
> > > > Application B is used throug IFrame of Application A.
> > > > OK button performs the actual action (in my case deletes an item from
> > > a
> > > > list) but is not closed after the execution of the action.
> > > >
> > > > Closing of the ModalWindow works normally when Application B is not
> > > used
> > > > through an IFrame.
> > > >
> > > > Any suggestions how this could be solved?  Or is the usage through an
> > > IFrame
> > > > a bad idea from start?
> > > >
> > > > Any help is appreciated!
> > > >
> > > > Mahavishnu
> > > >
> > >
> > > -
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> >
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Problem closing a ModalWindow when used through an IFrame

2007-11-03 Thread Deepak Mahavishnu
Hi Matej!
Have you been able to reproduce this problem?
DM

2007/11/1, Deepak Mahavishnu <[EMAIL PROTECTED]>:
>
> Hi Matej!
> And thanks for a quick response!
>
> I opened a jira issue related to this. The quick start is very straight
> forward:
>
> Just create a html page with this source:
>
> 
> 
> http://www.wicket-library.com/wicket-examples/ajax/modal-window.1";
> width="100%" height="100%">
> 
> 
>
> And then open "Show modal dialog with panel" and try to close the dialog.
>
> Mahavishnu
>
> 2007/11/1, Matej Knopp <[EMAIL PROTECTED]>:
> >
> > The modal window probably won't work well when paced in a page that is
> > loaded in iframe. Still, if you can provide a quickstart assigned to a
> > JIRA entry I will take a look if there is a quick fix for your
> > problem.
> >
> > -Matej
> >
> > On 11/1/07, Deepak Mahavishnu <[EMAIL PROTECTED]> wrote:
> > > Hello!
> > >
> > > I'm doing some POC testing to find out how a wicket application could
> > be
> > > used through an IFrame and noticed that closing of a ModalWindow
> > fails.
> > >
> > > My setup:
> > >
> > > Application A:
> > > -a dummy html page that has an IFrame
> > > -the contents of the IFrame is requested from Application B
> > > http://localhost:8080/mywicketapp/app/"; width="100%"
> > > height="500">
> > >
> > > Application B:
> > > -a Wicket application that uses a ModalWindow
> > > -deployed to tomcat:  http://localhost:8080/mywicketapp/
> > >
> > >
> > > Problem:
> > > The ModalWindow is not closed when OK ( or Cancel ) button is clicked
> > when
> > > Application B is used throug IFrame of Application A.
> > > OK button performs the actual action (in my case deletes an item from
> > a
> > > list) but is not closed after the execution of the action.
> > >
> > > Closing of the ModalWindow works normally when Application B is not
> > used
> > > through an IFrame.
> > >
> > > Any suggestions how this could be solved?  Or is the usage through an
> > IFrame
> > > a bad idea from start?
> > >
> > > Any help is appreciated!
> > >
> > > Mahavishnu
> > >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>


Re: Problem closing a ModalWindow when used through an IFrame

2007-11-01 Thread Deepak Mahavishnu
Hi Matej!
And thanks for a quick response!

I opened a jira issue related to this. The quick start is very straight
forward:

Just create a html page with this source:



http://www.wicket-library.com/wicket-examples/ajax/modal-window.1";
width="100%" height="100%">



And then open "Show modal dialog with panel" and try to close the dialog.

Mahavishnu

2007/11/1, Matej Knopp <[EMAIL PROTECTED]>:
>
> The modal window probably won't work well when paced in a page that is
> loaded in iframe. Still, if you can provide a quickstart assigned to a
> JIRA entry I will take a look if there is a quick fix for your
> problem.
>
> -Matej
>
> On 11/1/07, Deepak Mahavishnu <[EMAIL PROTECTED]> wrote:
> > Hello!
> >
> > I'm doing some POC testing to find out how a wicket application could be
> > used through an IFrame and noticed that closing of a ModalWindow fails.
> >
> > My setup:
> >
> > Application A:
> > -a dummy html page that has an IFrame
> > -the contents of the IFrame is requested from Application B
> > http://localhost:8080/mywicketapp/app/"; width="100%"
> > height="500">
> >
> > Application B:
> > -a Wicket application that uses a ModalWindow
> > -deployed to tomcat:  http://localhost:8080/mywicketapp/
> >
> >
> > Problem:
> > The ModalWindow is not closed when OK ( or Cancel ) button is clicked
> when
> > Application B is used throug IFrame of Application A.
> > OK button performs the actual action (in my case deletes an item from a
> > list) but is not closed after the execution of the action.
> >
> > Closing of the ModalWindow works normally when Application B is not used
> > through an IFrame.
> >
> > Any suggestions how this could be solved?  Or is the usage through an
> IFrame
> > a bad idea from start?
> >
> > Any help is appreciated!
> >
> > Mahavishnu
> >
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: Problem closing a ModalWindow when used through an IFrame

2007-11-01 Thread Matej Knopp
The modal window probably won't work well when paced in a page that is
loaded in iframe. Still, if you can provide a quickstart assigned to a
JIRA entry I will take a look if there is a quick fix for your
problem.

-Matej

On 11/1/07, Deepak Mahavishnu <[EMAIL PROTECTED]> wrote:
> Hello!
>
> I'm doing some POC testing to find out how a wicket application could be
> used through an IFrame and noticed that closing of a ModalWindow fails.
>
> My setup:
>
> Application A:
> -a dummy html page that has an IFrame
> -the contents of the IFrame is requested from Application B
> http://localhost:8080/mywicketapp/app/"; width="100%"
> height="500">
>
> Application B:
> -a Wicket application that uses a ModalWindow
> -deployed to tomcat:  http://localhost:8080/mywicketapp/
>
>
> Problem:
> The ModalWindow is not closed when OK ( or Cancel ) button is clicked when
> Application B is used throug IFrame of Application A.
> OK button performs the actual action (in my case deletes an item from a
> list) but is not closed after the execution of the action.
>
> Closing of the ModalWindow works normally when Application B is not used
> through an IFrame.
>
> Any suggestions how this could be solved?  Or is the usage through an IFrame
> a bad idea from start?
>
> Any help is appreciated!
>
> Mahavishnu
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]