Phaneesh,

you need to make accessible the Iframe widgets you create, e.g. through
a variable of your "master" Application class, so one Iframe widget can
get hold of the other during runtime.

Let's suppose you saved all your Iframes in an array "allMyIframes" of
your master Application class, then you can access one of them from an
Iframe app like this:
if (parent && parent.qx != window.qx) {
  var mySecondIframe =
parent.qx.core.Init.getInstance().getApplication().allMyIframes[1];
  ...

Now you should be able to invoke your desired method:
mySecondIframe.setMainFrame("default.html");

The saving of the Iframe widgets to the parent app works the same way
(e.g. through
"parent.qx.core.Init.getInstance().getApplication.addIframe(this.frameMain);"
which would add to the allMyIframes array).

(Alternatively to using the parent app as a keeper for your Iframe
widgets you could use a static array of your com.myapplication.Main
class, but only if all three embedded iframes are implemented using this
class.)

The problem with your approach is that you are calling an instance
method as if it were a class (static) method, hence the error message.

HTH,
=Thomas


Phaneesh N wrote:
> Hi,
>
> Thanks for the response. Let me explain my problem in detail. I have 1
> application with 3 IFrames. I have set 3 different applications to
> these 3 IFrames. Now, there is a Toolbar in one of the application in
> a IFrame. On click of the a toolbar button I have to change the
> application that is set for another IFrame.
>
> Can you please assist me in doing this.
> Thanks,
> Phaneesh
>
> ----- Original Message ----
> From: dperez <[EMAIL PROTECTED]>
> To: qooxdoo-devel@lists.sourceforge.net
> Sent: Monday, August 20, 2007 6:40:03 PM
> Subject: Re: [qooxdoo-devel] Access one application class instance
> from another application
>
>
> You can try something like this:
>
>                     sghe.udctc.utest.Main.setMainFrame.call("default.html",
> parent);
>
> to set 'this' to window.parent
>
>
> Phaneesh N wrote:
> >
> >
> > Hi All,
> > I am developing my application in 0.7.1.
> > I have two applications classes [set to two qx.embed.IFrame]. I want to
> > call a member method of application 1 from application 2. Here is the
> > code:
> >
> > Application 1:
> > qx.Class.define("com.myapplication.Main",
> > {
> >     extend : qx.application.Gui,
> >     statics :
> >     {
> >         setMainFrame: function(frameSource) {
> >             this.frameMain.setSource(frameSource);
> >         }
> >     },
> >     members :
> >     {
> >         frameMain: null,
> >         main : function()
> >         {
> >             // Call super class
> >             this.base(arguments);
> >
> >             //Set properties for IFrames
> >             this.frameMain = new qx.ui.embed.Iframe("default.html");
> >             this.frameMain.setLeft(0);
> >             this.frameMain.setTop(100);
> >             this.frameMain.setWidth("100%");
> >             this.frameMain.setBottom(30);
> >             this.frameMain.setBorder(null);
> >             this.frameMain.addToDocument();
> >         }
> >     }
> > });
> >
> > In Application 2:
> > var btnHome = new qx.ui.toolbar.Button("Home",
> > "resource/qx/icon/VistaInspirate/22/actions/go-home.png");
> >             btnHome.addEventListener("execute", function(e) {
> >                     sghe.udctc.utest.Main.setMainFrame("default.html");
> >                 }
> >             );
> >
> > But I get this.frameMain has no properties error. Please tell me am I
> > missing something here?
> >
>
> -- 
> View this message in context:
> http://www.nabble.com/Access-one-application-class-instance-from-another-application-tf4290088.html#a12235659
> Sent from the qooxdoo-devel mailing list archive at Nabble.com.
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems?  Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >>  http://get.splunk.com/
> _______________________________________________
> qooxdoo-devel mailing list
> qooxdoo-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
>
> ------------------------------------------------------------------------
> Moody friends. Drama queens. Your life? Nope! - their life, your story.
> Play Sims Stories at Yahoo! Games.
> <http://us.rd.yahoo.com/evt=48224/*http://sims.yahoo.com/>
> ------------------------------------------------------------------------
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems?  Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >>  http://get.splunk.com/
> ------------------------------------------------------------------------
>
> _______________________________________________
> qooxdoo-devel mailing list
> qooxdoo-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>   


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to