Iframe source change

View: New views
6 Messages — Rating Filter:   Alert me  

Iframe source change

by patkar_n001 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

I have a main application window split into two panes. The bottom pane has a embed IFrame.
From a html source opened in the iFrame window i want to change the source of the iframe to another html source on a button click event.

For example: In the main application.js I have
+++++++++++++++++++++++++++++++++++++++++
this.__iframe.setSource("myapplication/login.html");
+++++++++++++++++++++++++++++++++++++++++

on a button click in login.js, I need to set the Iframe source to another html (home.html).
Since Iframe object, which is created in application.js, is not available in login.js I am not able to
do the following,
++++++++++++++++++++++++++++++++++
iframe.setSource("myapplication/home.html");
++++++++++++++++++++++++++++++++++

Can you please let me know how this can be achieved.

Warm regards,
Narasimha

Re: Iframe source change

by Matthew Gregory :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi patkar,
I think I understand your question and it is easy to answer :)

In application.js add a function like this:

getMyFrame : function()
{
   return this.__iframe;
}


then from login.js you can access the iframe by doing this:

qx.core.Init.getApplication().getMyFrame()

HTH,
Matt

patkar_n001 wrote:

> Hello,
>
> I have a main application window split into two panes. The bottom pane has a
> embed IFrame.
>>From a html source opened in the iFrame window i want to change the source
> of the iframe to another html source on a button click event.
>
> For example: In the main application.js I have
> +++++++++++++++++++++++++++++++++++++++++
> this.__iframe.setSource("myapplication/login.html");
> +++++++++++++++++++++++++++++++++++++++++
>
> on a button click in login.js, I need to set the Iframe source to another
> html (home.html).
> Since Iframe object, which is created in application.js, is not available in
> login.js I am not able to
> do the following,
> ++++++++++++++++++++++++++++++++++
> iframe.setSource("myapplication/home.html");
> ++++++++++++++++++++++++++++++++++
>
> Can you please let me know how this can be achieved.
>
> Warm regards,
> Narasimha
>


------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@...
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Re: Iframe source change

by patkar_n001 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks a lot for quick resolution Matt.

But the problem here is, I have main application which has a container class for buttons and headers etc.
And this container has iframe. And I am loading different smaller applications in this iframe. The design is similar to demoBrowser application.

Application.js extends qx.application.Standalone, container class extends qx.ui.container.Composite and Login page extends  qx.application.Standalone.

Now under these circumstances, when I do qx.core.Init.getApplication() I get Login page's handler and not application.js's handler. Thats why I do not get the iframe.


Can you please help in this regard.

Thanks & Regards
Narasimha


Matthew Gregory wrote:
Hi patkar,
I think I understand your question and it is easy to answer :)

In application.js add a function like this:

getMyFrame : function()
{
   return this.__iframe;
}


then from login.js you can access the iframe by doing this:

qx.core.Init.getApplication().getMyFrame()

HTH,
Matt

patkar_n001 wrote:
> Hello,
>
> I have a main application window split into two panes. The bottom pane has a
> embed IFrame.
>>From a html source opened in the iFrame window i want to change the source
> of the iframe to another html source on a button click event.
>
> For example: In the main application.js I have
> +++++++++++++++++++++++++++++++++++++++++
> this.__iframe.setSource("myapplication/login.html");
> +++++++++++++++++++++++++++++++++++++++++
>
> on a button click in login.js, I need to set the Iframe source to another
> html (home.html).
> Since Iframe object, which is created in application.js, is not available in
> login.js I am not able to
> do the following,
> ++++++++++++++++++++++++++++++++++
> iframe.setSource("myapplication/home.html");
> ++++++++++++++++++++++++++++++++++
>
> Can you please let me know how this can be achieved.
>
> Warm regards,
> Narasimha
>


------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Re: Iframe source change

by Jonathan Weiß-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello Narasimha,


you wrote that you call qx.core.Init.getApplication() and that you get the Login page instead of the application from your application.js. From where do you call getApplication()? If you are calling this from an iframe you have to use parent.qx.core.Init.getApplication().

Please let me know if I could help you.

Cheers,
Jonathan


On 08.07.2009, at 14:39, patkar_n001 wrote:


Hello,

I have a main application window split into two panes. The bottom pane has a
embed IFrame.
From a html source opened in the iFrame window i want to change the source
of the iframe to another html source on a button click event.

For example: In the main application.js I have
+++++++++++++++++++++++++++++++++++++++++
this.__iframe.setSource("myapplication/login.html");
+++++++++++++++++++++++++++++++++++++++++

on a button click in login.js, I need to set the Iframe source to another
html (home.html).
Since Iframe object, which is created in application.js, is not available in
login.js I am not able to
do the following,
++++++++++++++++++++++++++++++++++
iframe.setSource("myapplication/home.html");
++++++++++++++++++++++++++++++++++

Can you please let me know how this can be achieved.

Warm regards,
Narasimha

--
View this message in context: http://www.nabble.com/Iframe-source-change-tp24390721p24390721.html
Sent from the qooxdoo-devel mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@...
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

--
Jonathan Weiß
JavaScript-Framework-Entwickler

Development Technology & Architecture - Web Technologies

1&1 Internet AG
Ernst-Frey-Straße 9 · DE-76135 Karlsruhe

Amtsgericht Montabaur / HRB 6484
Vorstände: Henning Ahlert, Ralph Dommermuth, Matthias Ehrlich, Thomas Gottschlich, Robert Hoffmann, Markus Huhn, Hans-Henning Kettler, Dr. Oliver Mauss, Jan Oetjen Aufsichtsratsvorsitzender: Michael Scheeren


------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@...
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Re: Iframe source change

by Matthew Gregory :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

OK, I think there is a helper function in qx to get the parent window
but I couldn't find it.
Your might be able to get away with something like:

window.parent.qx.core.Init.getApplication().getMyFrame()

But I am not completely sure, if you have a good inspector check the dom
properties around your iFrame until you get a reference to the parent's qx.

Perhpas somebody else knows of a qx way to do this?

patkar_n001 wrote:

> Thanks a lot for quick resolution Matt.
>
> But the problem here is, I have main application which has a container class
> for buttons and headers etc.
> And this container has iframe. And I am loading different smaller
> applications in this iframe. The design is similar to demoBrowser
> application.
>
> Application.js extends qx.application.Standalone, container class extends
> qx.ui.container.Composite and Login page extends  qx.application.Standalone.
>
> Now under these circumstances, when I do qx.core.Init.getApplication() I get
> Login page's handler and not application.js's handler. Thats why I do not
> get the iframe.
>
>
> Can you please help in this regard.
>
> Thanks & Regards
> Narasimha
>
>
>
> Matthew Gregory wrote:
>> Hi patkar,
>> I think I understand your question and it is easy to answer :)
>>
>> In application.js add a function like this:
>>
>> getMyFrame : function()
>> {
>>    return this.__iframe;
>> }
>>
>>
>> then from login.js you can access the iframe by doing this:
>>
>> qx.core.Init.getApplication().getMyFrame()
>>
>> HTH,
>> Matt
>>
>> patkar_n001 wrote:
>>> Hello,
>>>
>>> I have a main application window split into two panes. The bottom pane
>>> has a
>>> embed IFrame.
>>> >From a html source opened in the iFrame window i want to change the
> source
>>> of the iframe to another html source on a button click event.
>>>
>>> For example: In the main application.js I have
>>> +++++++++++++++++++++++++++++++++++++++++
>>> this.__iframe.setSource("myapplication/login.html");
>>> +++++++++++++++++++++++++++++++++++++++++
>>>
>>> on a button click in login.js, I need to set the Iframe source to another
>>> html (home.html).
>>> Since Iframe object, which is created in application.js, is not available
>>> in
>>> login.js I am not able to
>>> do the following,
>>> ++++++++++++++++++++++++++++++++++
>>> iframe.setSource("myapplication/home.html");
>>> ++++++++++++++++++++++++++++++++++
>>>
>>> Can you please let me know how this can be achieved.
>>>
>>> Warm regards,
>>> Narasimha
>>>
>>
>> ------------------------------------------------------------------------------
>> Enter the BlackBerry Developer Challenge  
>> This is your chance to win up to $100,000 in prizes! For a limited time,
>> vendors submitting new applications to BlackBerry App World(TM) will have
>> the opportunity to enter the BlackBerry Developer Challenge. See full
>> prize  
>> details at: http://p.sf.net/sfu/Challenge
>> _______________________________________________
>> qooxdoo-devel mailing list
>> qooxdoo-devel@...
>> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>>
>>
>


------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@...
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Re: Iframe source change

by patkar_n001 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks a lot Matt and Jonathan.

"window.parent.qx.core.Init.getApplication().getMyFrame()"
this didn't work as it was returning a NULL, for reasons unknown, even though we had function getMyFrame in application.js returning this.viewer.__iframe


So instead of getting the iframe, we implemented setSource in viewer class (derived from container) and get viewer in application.js. And this works.

Now application.js has
        getViewer : function()
        {
            return this.viewer;
        }

login.js has,
       verify: function()
       {
                var viewer = window.parent.qx.core.Init.getApplication().getViewer();
                viewer.setSource("myapplication/home.html");
       }

and viewer.js has
    setSource : function(text)
        {
                his.__iframe.setSource(text);
        },

Let me know, if there is any other better method.

Thanks & Regards
Narasimha

Matthew Gregory wrote:
OK, I think there is a helper function in qx to get the parent window
but I couldn't find it.
Your might be able to get away with something like:

window.parent.qx.core.Init.getApplication().getMyFrame()

But I am not completely sure, if you have a good inspector check the dom
properties around your iFrame until you get a reference to the parent's qx.

Perhpas somebody else knows of a qx way to do this?

patkar_n001 wrote:
> Thanks a lot for quick resolution Matt.
>
> But the problem here is, I have main application which has a container class
> for buttons and headers etc.
> And this container has iframe. And I am loading different smaller
> applications in this iframe. The design is similar to demoBrowser
> application.
>
> Application.js extends qx.application.Standalone, container class extends
> qx.ui.container.Composite and Login page extends  qx.application.Standalone.
>
> Now under these circumstances, when I do qx.core.Init.getApplication() I get
> Login page's handler and not application.js's handler. Thats why I do not
> get the iframe.
>
>
> Can you please help in this regard.
>
> Thanks & Regards
> Narasimha
>
>
>
> Matthew Gregory wrote:
>> Hi patkar,
>> I think I understand your question and it is easy to answer :)
>>
>> In application.js add a function like this:
>>
>> getMyFrame : function()
>> {
>>    return this.__iframe;
>> }
>>
>>
>> then from login.js you can access the iframe by doing this:
>>
>> qx.core.Init.getApplication().getMyFrame()
>>
>> HTH,
>> Matt
>>
>> patkar_n001 wrote:
>>> Hello,
>>>
>>> I have a main application window split into two panes. The bottom pane
>>> has a
>>> embed IFrame.
>>> >From a html source opened in the iFrame window i want to change the
> source
>>> of the iframe to another html source on a button click event.
>>>
>>> For example: In the main application.js I have
>>> +++++++++++++++++++++++++++++++++++++++++
>>> this.__iframe.setSource("myapplication/login.html");
>>> +++++++++++++++++++++++++++++++++++++++++
>>>
>>> on a button click in login.js, I need to set the Iframe source to another
>>> html (home.html).
>>> Since Iframe object, which is created in application.js, is not available
>>> in
>>> login.js I am not able to
>>> do the following,
>>> ++++++++++++++++++++++++++++++++++
>>> iframe.setSource("myapplication/home.html");
>>> ++++++++++++++++++++++++++++++++++
>>>
>>> Can you please let me know how this can be achieved.
>>>
>>> Warm regards,
>>> Narasimha
>>>
>>
>> ------------------------------------------------------------------------------
>> Enter the BlackBerry Developer Challenge  
>> This is your chance to win up to $100,000 in prizes! For a limited time,
>> vendors submitting new applications to BlackBerry App World(TM) will have
>> the opportunity to enter the BlackBerry Developer Challenge. See full
>> prize  
>> details at: http://p.sf.net/sfu/Challenge
>> _______________________________________________
>> qooxdoo-devel mailing list
>> qooxdoo-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>>
>>
>


------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel