Cloning qooxdoo objects

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Cloning qooxdoo objects

Deepak Mishra
Hi !
I am trying to clone a qooxdoo object, which is a "composite" containing other elements using the .clone() function
like this -

var x= superwin[2].getChildren()[1].clone()

now I am calling a function to create a new windows and passing this object 'x' to be added to it.

like this -

this.lastWindow(x)

last window declaration & body

   lastWindow:function (a)
    {
      var win = new qx.ui.window.Window("!!The LAST WINDOW!!", "icon/16/apps/internet-feed-reader.png");
      win.setLayout(new qx.ui.layout.VBox(10));
      win.setStatus("Application is ready");
      win.open();

      this.getRoot().add(win,
      {
        left : 350,
        top  : 120
      });

      var atom = new qx.ui.basic.Atom("Foundry Optimizer", "icon/22/apps/utilities-calculator.png");
      win.add(atom);
      //a.setLayout(new qx.ui.layout.VBox(10));
      win.add(a);

return win;

}

     

When i call the function -
this.lastWindow(x)
 i get an error -

[Exception... "'Error: At least one child in control qx.ui.container.Composite[2f6] requires a layout, but no one was defined!' when calling method: [nsIDOMEventListener::handleEvent]" nsresult: "0x8057001c (NS_ERROR_XPC_JS_THREW_JS_OBJECT)" location: "<unknown>" data: no]

I tried a simple solution -
i did this inside the lastWindow() function -
a.setLayout(new qx.ui.layout.VBox(10));

then it compains it requires a layout for the groupbox object inside the composite .

I just cant figure it out.


Deepak Mishra





------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Cloning qooxdoo objects

thron7
Deepak,

can you cut down the sample to the essential code that produces the error?

T.

Deepak Mishra wrote:

> Hi !
> I am trying to clone a qooxdoo object, which is a "composite"
> containing other elements using the .clone() function
> like this -
>
> *var x= superwin[2].getChildren()[1].clone()*
>
> now I am calling a function to create a new windows and passing this
> object 'x' to be added to it.
>
> like this -
>
> *this.lastWindow(x)*
>
> last window declaration & body
>
> *   lastWindow:function (a)
>     {
>       var win = new qx.ui.window.Window("!!The LAST WINDOW!!",
> "icon/16/apps/internet-feed-reader.png");
>       win.setLayout(new qx.ui.layout.VBox(10));
>       win.setStatus("Application is ready");
>       win.open();
>
>       this.getRoot().add(win,
>       {
>         left : 350,
>         top  : 120
>       });
>
>       var atom = new qx.ui.basic.Atom("Foundry Optimizer",
> "icon/22/apps/utilities-calculator.png");
>       win.add(atom);
>       //a.setLayout(new qx.ui.layout.VBox(10));
>       win.add(a);
>
> return win;
>
> }*
>      
>
> When i call the function -
> *this.lastWindow(x)
> * i get an error -
>
> /*[Exception... "'Error: At least one child in control
> qx.ui.container.Composite[2f6] requires a layout, but no one was
> defined!' when calling method: [nsIDOMEventListener::handleEvent]"
> nsresult: "0x8057001c (NS_ERROR_XPC_JS_THREW_JS_OBJECT)" location:
> "<unknown>" data: no]
> */
> I tried a simple solution -
> i did this inside the lastWindow() function -
> *a.setLayout(new qx.ui.layout.VBox(10));
> *
> then it compains it requires a layout for the groupbox object inside
> the composite .
>
> I just cant figure it out.
>
>
> Deepak Mishra
>
>
>
>
> ------------------------------------------------------------------------
>
> ------------------------------------------------------------------------------
> Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
> software. With Adobe AIR, Ajax developers can use existing skills and code to
> build responsive, highly engaging applications that combine the power of local
> resources and data with the reach of the web. Download the Adobe AIR SDK and
> Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
> ------------------------------------------------------------------------
>
> _______________________________________________
> qooxdoo-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>  

------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Cloning qooxdoo objects

Deepak Mishra
Hi !
sure,

   lastWindow:function (a)
    {
      var win = new qx.ui.window.Window("!!The LAST WINDOW!!", "icon/16/apps/internet-feed-reader.png");
........
      win.add(a);
return win;
}

     

When i call the function -
var x= superwin[2].getChildren()[1].clone()
this.lastWindow(x)
 
i get an error -

[Exception... "'Error: At least one child in control qx.ui.container.Composite[2f6] requires a layout, but no one was defined!' when calling method: [nsIDOMEventListener::handleEvent]" nsresult: "0x8057001c (NS_ERROR_XPC_JS_THREW_JS_OBJECT)" location: "<unknown>" data: no]



Deepak Mishra



------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Cloning qooxdoo objects

Thomas Herchenroeder


Deepak Mishra wrote:

> Hi !
> sure,
>
> *   lastWindow:function (a)
>     {
>       var win = new qx.ui.window.Window("!!The LAST WINDOW!!",
> "icon/16/apps/internet-feed-reader.png");
> ........
>       win.add(a);
> return win;
> }*
>      
>
> When i call the function -
> *var x= superwin[2].getChildren()[1].clone()*
> *this.lastWindow(x)*

The "clone" method is experimental - have you tried with a
hand-constructed widget?

T.

>  
> i get an error -
>
> /*[Exception... "'Error: At least one child in control
> qx.ui.container.Composite[2f6] requires a layout, but no one was
> defined!' when calling method: [nsIDOMEventListener::handleEvent]"
> nsresult: "0x8057001c (NS_ERROR_XPC_JS_THREW_JS_OBJECT)" location:
> "<unknown>" data: no]
> */
>
>
> Deepak Mishra
>
>
> ------------------------------------------------------------------------
>
> ------------------------------------------------------------------------------
> Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
> software. With Adobe AIR, Ajax developers can use existing skills and code to
> build responsive, highly engaging applications that combine the power of local
> resources and data with the reach of the web. Download the Adobe AIR SDK and
> Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
> ------------------------------------------------------------------------
>
> _______________________________________________
> qooxdoo-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>  

------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Cloning qooxdoo objects

Deepak Mishra
Hi,
No I used all qooxdoo widgets.
A group box , with some standard widgets inside a composite.

The error is probably just because, the clone() method is not copying the layout property to the new object.
Because if I manually set the layout to the cloned composite, another error appears regarding layout property missing on object contained within the composite object.



I initially tried using a javascript hack:
cloned_object=eval( uneval ( object ) ), but it did not work because of obvious reasons.

Is there any other thing I can do ?

Deepak Mishra


The "clone" method is experimental - have you tried with a
hand-constructed widget?

T.



------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Cloning qooxdoo objects

Thomas Herchenroeder


Deepak Mishra wrote:
> Hi,
> No I used all qooxdoo widgets.

What I meant was: an object obtained through 'new', not '.clone()'.

> A group box , with some standard widgets inside a composite.
>
> The error is probably just because, the clone() method is not copying
> the layout property to the new object.
> Because if I manually set the layout to the cloned composite, another
> error appears regarding layout property missing on object contained
> within the composite object.

As I said, "experimental".


>
>
>
> I initially tried using a javascript hack:
> cloned_object=eval( uneval ( object ) ), but it did not work because
> of obvious reasons.
>
> Is there any other thing I can do ?

Don't clone.

T.

>
> Deepak Mishra
>
>
>     The "clone" method is experimental - have you tried with a
>     hand-constructed widget?
>
>     T.
>
>
> ------------------------------------------------------------------------
>
> ------------------------------------------------------------------------------
> Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
> software. With Adobe AIR, Ajax developers can use existing skills and code to
> build responsive, highly engaging applications that combine the power of local
> resources and data with the reach of the web. Download the Adobe AIR SDK and
> Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
> ------------------------------------------------------------------------
>
> _______________________________________________
> qooxdoo-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>  

------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel