Hi,
i am not a qx developer but i would handle this problem like this:

1. you sould extend your custom class with a own property like
myLinkedLabel, it will be a reference of the label object from the other
frame.
so i would define in the constructor part of your class this property
maybe like (this.myLinkedLabel = null);
In the member part of your class i would define a get an a set function
like this:
setmyLinkedLabel : function(obj)
{
 this.myLinkedLabel = obj;
},

getmyLinkedLabel : function()
{
 return this.myLinkedLabel;
},

now you have to make your labels reachable from  outside of your class, so
define like this in your custom.class:
this.myReachableLabel = label = new qx.ui.basic.Label("Some Text");

In your main app i would do like this:


// create your frames
var frame1 = new custom.class;

var frame2 = new custom.class;

frame1.setmyLinkedLabel(frame2.myReachableLabel);

frame2.setmyLinkedLabel(frame1.myReachableLabel);

and perhaps dont forget to handle this references with your button execute
events.

As i told, i am not a official qx dev and may be i am wrong. So i would
like to see a smarter way from the big js experts ;)

By the way, is there a function to access directly to the "opener" class
from the custom class? (You know like opener in js if you execute a
window.open() function)

regards Sak


>
> I run into a really basic question for which I didn't found a satisfactory
> answer.
>
> The model of my problem:
>
> I've got a mainContainer which is added to the my custom application's
> root
> (this.getRoot().add(mainContainer)
> This mainContainer have two frames, call them frameOne and frameTwo. They
> both are instantiated from the same class object: custom.Frame. This Frame
> is a container which contains a label and a button.
>
> Here is a visual draft:
> http://blok.appspot.com/?id=e9bfcf90a6eab84069c318f29222404b2c925eee
>
> My goal is that when the frameOne.button is pressed I would like to change
> the frameTwo.label and vica versa, when the frameTwo.button is pressed I
> would like to change the frameOne.label.
>
> How could be achieved the communication between the two frames?
> How will they know about each other?
> How could be given the frameOne.label to the
> frameTwo.button.addListener("execute", frameTwo.label.setLabel("button in
> another frame is pressed") and vica versa?
>
> Is it possible to handle this kind of communication between instances
> without to make my mainFrame a global object or to pass the applications
> main "this" to all the constructors which have to reach another existing
> objects (this.mainFrame)?
> Is there a way to find out the Application itself from an instance of a
> class which is inside of my custom package, something like
> getApplicationRoot() method?
>
> I hope I could write down my problem cleare enough.
> --
> View this message in context:
> http://n2.nabble.com/OO-programming-theory-question-tp4269104p4269104.html
> Sent from the qooxdoo mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> This SF.Net email is sponsored by the Verizon Developer Community
> Take advantage of Verizon's best-in-class app development support
> A streamlined, 14 day to market process makes app distribution fast and
> easy
> Join now and get one step closer to millions of Verizon customers
> http://p.sf.net/sfu/verizon-dev2dev
> _______________________________________________
> qooxdoo-devel mailing list
> qooxdoo-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>



------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to