Re: [qooxdoo-devel] The correct use of getDomElement()

2013-02-14 Thread totty
Well this is my quick implementation (in constructor):

var domEl = this.getContentElement()

// in order to keep things in sync this element is created
// here and it's not appended to the dom. It's only
// appended when the domEl appears. 
var readyDomEl = new qx.html.Element();
domEl.addListener("appear", function(){
domEl.add(readyDomEl);
});


the "this" is a qx.ui.container.Composite instance.



--
View this message in context: 
http://qooxdoo.678.n2.nabble.com/The-correct-use-of-getDomElement-tp6993052p7582838.html
Sent from the qooxdoo mailing list archive at Nabble.com.

--
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
___
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


Re: [qooxdoo-devel] The correct use of getDomElement()

2011-11-17 Thread Marco Pompili
Hi Thom,

Thanks for the directions. I've checked the contributions, the external
libraries are initialized when the "appear" event is fired. But i guess I've
found a compromise. I post it just for documentation. In my case highcharts
needs an object as configuration, so I first fill the object with all the
options and then pass it to highcharts when the "appear" event is fired. If
a property of the configuration object is changed the widget reloads the
highcharts main class with the new configuration object. I guess it's
doable. I'm looking for an event that looks for change in a javascript
object, or maybe use a qooxdoo object and then convert it into a native js
object.

Thanks to everybody who has intervened in this discussion.

-
La coincidenza non ha madre.
--
View this message in context: 
http://qooxdoo.678.n2.nabble.com/The-correct-use-of-getDomElement-tp6993052p7005298.html
Sent from the qooxdoo mailing list archive at Nabble.com.

--
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
___
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


Re: [qooxdoo-devel] The correct use of getDomElement()

2011-11-16 Thread thron7
Marco,

here are some projects you might want to look at, concerning integration
of external JS libraries:

- the Playground uses the ACE editor of the Cloud9 project.
- QxDyGraph
- QxJqPlot
- QxProtovis
  ... are all qooxdoo-contrib projects that wrap an external library with
a qooxdoo interface.

HTH,
T.

> Hi all,
>
> I've tried every flush method of the static classes in the
> qx.ui.core.queue
> package. And still in the constructor of the widget I'm testing (it's a
> class that inherits from qx.ui.core.Widget) the dom elements cannot be
> found
> by highcharts. Time ago i've read that Martin or Thomas (can't remember
> for
> sure) has integrated tinyMCE in qooxdoo. How did you done that ? Using the
> "appear" event ? Or in another way so the instance of the js external
> library can be accessed from qooxdoo from the constructor ?
>
> Thank you all for your support, i appreciate it!
>
> -
> La coincidenza non ha madre.
> --
> View this message in context:
> http://qooxdoo.678.n2.nabble.com/The-correct-use-of-getDomElement-tp6993052p7001100.html
> Sent from the qooxdoo mailing list archive at Nabble.com.
>
> --
> All the data continuously generated in your IT infrastructure
> contains a definitive record of customers, application performance,
> security threats, fraudulent activity, and more. Splunk takes this
> data and makes sense of it. IT sense. And common sense.
> http://p.sf.net/sfu/splunk-novd2d
> ___
> qooxdoo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
>
>



--
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
___
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


Re: [qooxdoo-devel] The correct use of getDomElement()

2011-11-16 Thread Marco Pompili
Hi all,

I've tried every flush method of the static classes in the qx.ui.core.queue
package. And still in the constructor of the widget I'm testing (it's a
class that inherits from qx.ui.core.Widget) the dom elements cannot be found
by highcharts. Time ago i've read that Martin or Thomas (can't remember for
sure) has integrated tinyMCE in qooxdoo. How did you done that ? Using the
"appear" event ? Or in another way so the instance of the js external
library can be accessed from qooxdoo from the constructor ?

Thank you all for your support, i appreciate it!

-
La coincidenza non ha madre.
--
View this message in context: 
http://qooxdoo.678.n2.nabble.com/The-correct-use-of-getDomElement-tp6993052p7001100.html
Sent from the qooxdoo mailing list archive at Nabble.com.

--
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
___
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


Re: [qooxdoo-devel] The correct use of getDomElement()

2011-11-16 Thread Alexander Steitz
Hi Marco,

there are basically two options:

* use the "appear" event and then initialize your external library
  Within the "appear" listener method you can be sure the DOM element is 
created

* use your own subclass of "qx.ui.core.Widget" and "qx.html.Element" to have 
the full control over the DOM element which is created. Override the 
"_createDomElement" and the "_insertChildren" method. With the first you can 
create your specific DOM element you need (if that's really necessary at all) 
and with the second method the DOM is actually added to the DOM. Right after 
this operation you can hand it over to your external lib as reference.

Regards,
  Alex

On Wednesday 16 November 2011 00:00:14 Marco Pompili wrote:
> I didn't noticed this class till now. Very interesting. Thank you Thomas.
> I've inserted the function after the inner content of the widget is created
> overriding the _createContentElement of qx.ui.core.Widget, like this:
> 
> _createContentElement : function () {
> // Generates random div id
> this._id = Math.ceil(Math.random() * 1).toString();
> 
> var content = new qx.html.Element("div", {
>   overflowX : "hidden",
>   overflowY : "hidden"
> }, {
>   id : this._id
> });
> 
> qx.ui.core.queue.Manager.flush();
> 
> return content;
> }
> 
> Still no luck, but I guess that I'm getting closer to a solution. If you
> have another idea on where should i call qx.ui.core.queue.Manager.flush let
> me know. Thank you for your response.
> 
> -
> La coincidenza non ha madre.

--
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
___
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


Re: [qooxdoo-devel] The correct use of getDomElement()

2011-11-15 Thread Marco Pompili
I didn't noticed this class till now. Very interesting. Thank you Thomas.
I've inserted the function after the inner content of the widget is created
overriding the _createContentElement of qx.ui.core.Widget, like this:

_createContentElement : function () {
// Generates random div id
this._id = Math.ceil(Math.random() * 1).toString();

var content = new qx.html.Element("div", {
overflowX : "hidden",
overflowY : "hidden"
}, {
id : this._id
});

qx.ui.core.queue.Manager.flush();

return content;
}

Still no luck, but I guess that I'm getting closer to a solution. If you
have another idea on where should i call qx.ui.core.queue.Manager.flush let
me know. Thank you for your response.

-
La coincidenza non ha madre.
--
View this message in context: 
http://qooxdoo.678.n2.nabble.com/The-correct-use-of-getDomElement-tp6993052p6998298.html
Sent from the qooxdoo mailing list archive at Nabble.com.

--
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
___
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


Re: [qooxdoo-devel] The correct use of getDomElement()

2011-11-15 Thread Thomas Herchenroeder
> I need that the DOM Elements of the widget are in the document before the
> user triggers the "appear" event.

Did you try qx.ui.core.queue.Manager.flush?!

T.



--
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
___
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


Re: [qooxdoo-devel] The correct use of getDomElement()

2011-11-15 Thread Marco Pompili
Hi Fritz thank you for the quick response,

The fact is when this dom elements are ready in the constructor. I've seen
that qooxdoo Widget build a container div and a content div, and inside them
inserts the child elements. Alex was talking about qooxdoo lazy element
creation, that the elements are added in the DOM only when a widget appears.
I need that the DOM Elements of the widget are in the document before the
user triggers the "appear" event.

Hope I'm getting this problem from the right perspective.

-
La coincidenza non ha madre.
--
View this message in context: 
http://qooxdoo.678.n2.nabble.com/The-correct-use-of-getDomElement-tp6993052p6996872.html
Sent from the qooxdoo mailing list archive at Nabble.com.

--
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
___
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


Re: [qooxdoo-devel] The correct use of getDomElement()

2011-11-15 Thread Fritz Zaucker
Hi Marco,

On Tue, 15 Nov 2011, Marco Pompili wrote:

> Yes but if i use the appear event i can't do anything from the constructor
> that is executed before the appear event is fired.

you can do "everything" from the constructor except adding things to
none-existing dom elements.

But I didn't follow the discussion very closely, so I might well be missing
something.

Cheers,
Fritz

>
> -
> La coincidenza non ha madre.
> --
> View this message in context: 
> http://qooxdoo.678.n2.nabble.com/The-correct-use-of-getDomElement-tp6993052p6996768.html
> Sent from the qooxdoo mailing list archive at Nabble.com.
>
> --
> RSA(R) Conference 2012
> Save $700 by Nov 18
> Register now
> http://p.sf.net/sfu/rsa-sfdev2dev1
> ___
> qooxdoo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
>

-- 
Oetiker+Partner AG  tel: +41 62 775 9903 (direct)
Fritz Zaucker+41 62 775 9900 (switch board)
Aarweg 15+41 79 675 0630 (mobile)
CH-4600 Olten   fax: +41 62 775 9905
Schweiz web: www.oetiker.ch

--
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
___
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


Re: [qooxdoo-devel] The correct use of getDomElement()

2011-11-15 Thread Marco Pompili
I'll sum it up a little. If I use the "appear" event and i try to do this in
the widget I've overridden:

console.log(document.getElementById("hc")); == is null

this.addListener("appear", function()
{
console.log(document.getElementById("hc")); == the div is in the DOM
}, this);

-
La coincidenza non ha madre.
--
View this message in context: 
http://qooxdoo.678.n2.nabble.com/The-correct-use-of-getDomElement-tp6993052p6996783.html
Sent from the qooxdoo mailing list archive at Nabble.com.

--
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
___
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


Re: [qooxdoo-devel] The correct use of getDomElement()

2011-11-15 Thread Marco Pompili
Hi Fritz,

Yes but if i use the appear event i can't do anything from the constructor
that is executed before the appear event is fired.

-
La coincidenza non ha madre.
--
View this message in context: 
http://qooxdoo.678.n2.nabble.com/The-correct-use-of-getDomElement-tp6993052p6996768.html
Sent from the qooxdoo mailing list archive at Nabble.com.

--
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
___
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


Re: [qooxdoo-devel] The correct use of getDomElement()

2011-11-15 Thread Fritz Zaucker
Don't you need the Qx appear event?

Cheers,
Fritz

On Tue, 15 Nov 2011, Marco Pompili wrote:

> Hi Alex,
>
> Highcharts is loaded from the config.json file using an add-script attribute
> on source and build. The main problem is that i must pass the id of a div to
> create an instance of highchart. Also i've added jquery that is required by
> highcharts with the same method with "add-script".
>
> _createDomElement : function() {
> return qx.bom.Element.create("div", { id : "hc" });
> new Highcharts.Chart({
> chart : {
>   renderTo : "hc",
>   defaultSeriesType : "column"
> }
> });
> }
>
> Highcharts it's still not loading because cannot find the 
id="hc"> DOM Element. It's like i need a ready event as in jquery. > > - > La coincidenza non ha madre. > -- > View this message in context: > http://qooxdoo.678.n2.nabble.com/The-correct-use-of-getDomElement-tp6993052p6996585.html > Sent from the qooxdoo mailing list archive at Nabble.com. > > -- > RSA(R) Conference 2012 > Save $700 by Nov 18 > Register now > http://p.sf.net/sfu/rsa-sfdev2dev1 > ___ > qooxdoo-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel > > -- Oetiker+Partner AG tel: +41 62 775 9903 (direct) Fritz Zaucker+41 62 775 9900 (switch board) Aarweg 15+41 79 675 0630 (mobile) CH-4600 Olten fax: +41 62 775 9905 Schweiz web: www.oetiker.ch -- RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 ___ qooxdoo-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Re: [qooxdoo-devel] The correct use of getDomElement()

2011-11-15 Thread Marco Pompili
Hi Alex,

Highcharts is loaded from the config.json file using an add-script attribute
on source and build. The main problem is that i must pass the id of a div to
create an instance of highchart. Also i've added jquery that is required by
highcharts with the same method with "add-script".

_createDomElement : function() {
return qx.bom.Element.create("div", { id : "hc" });
new Highcharts.Chart({
chart : {
renderTo : "hc",
defaultSeriesType : "column"
}
});
}

Highcharts it's still not loading because cannot find the 
DOM Element. It's like i need a ready event as in jquery. - La coincidenza non ha madre. -- View this message in context: http://qooxdoo.678.n2.nabble.com/The-correct-use-of-getDomElement-tp6993052p6996585.html Sent from the qooxdoo mailing list archive at Nabble.com. -- RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 ___ qooxdoo-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Re: [qooxdoo-devel] The correct use of getDomElement()

2011-11-15 Thread Alexander Steitz
Hi Marco,

On Monday 14 November 2011 23:46:26 Marco Pompili wrote:
> So you are saying to override _createContainerElement of qx.ui.core.Widget
> and _createDomElement of qx.html.Element.
> 
> >From what I've seen _createContainerElement returns an qx.html.Element and
> 
> _createDomElement returns a DOM Element using qx.bom.Element.create.
> 
> >From what I've understood from your suggestion I've done this. I've
> 
> overridden the _createContainerElement of the widget that is loading the
> Highchart object. So now it returns a highcharts.bom.Element instead, that
> overrides _createDomElement like this:
> 
> _createDomElement : function() {
> return qx.bom.Element.create("div", { id : "hc" });
> }
> 
> Where hc is the div id that highcharts should use.
> 
> This didn't solve the problem, highcharts cannot find the div. I don't know
> if I've understood what you suggested, guess not.
I though of to override the "_createContainerElement" method to be able to 
create a custom instance of "qx.html.Element". This enables you to create a 
custom "_createDomElement" method where you directly create an instance of 
highcharts.

--snip--
_createDomElement: function()
{
  var div = qx.bom.Element.create("div", { id : "hc" });
  var highCharts = new highCharts(div);

  return div;
}
--snip--

This above is pseudo-code, don't know how to create a highcharts instance. The 
important thing is that highcharts has to be available at that time.

Regards,
  Alex

--
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
___
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


Re: [qooxdoo-devel] The correct use of getDomElement()

2011-11-14 Thread Marco Pompili
Hi Alex, thank you for your reply.

So you are saying to override _createContainerElement of qx.ui.core.Widget
and _createDomElement of qx.html.Element.

>From what I've seen _createContainerElement returns an qx.html.Element and
_createDomElement returns a DOM Element using qx.bom.Element.create.

>From what I've understood from your suggestion I've done this. I've
overridden the _createContainerElement of the widget that is loading the
Highchart object. So now it returns a highcharts.bom.Element instead, that
overrides _createDomElement like this:

_createDomElement : function() {
return qx.bom.Element.create("div", { id : "hc" });
}

Where hc is the div id that highcharts should use.

This didn't solve the problem, highcharts cannot find the div. I don't know
if I've understood what you suggested, guess not.

-
La coincidenza non ha madre.
--
View this message in context: 
http://qooxdoo.678.n2.nabble.com/The-correct-use-of-getDomElement-tp6993052p6994453.html
Sent from the qooxdoo mailing list archive at Nabble.com.

--
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
___
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


Re: [qooxdoo-devel] The correct use of getDomElement()

2011-11-14 Thread Alexander Steitz
Hi Marco,

On Monday 14 November 2011 17:18:17 Marco Pompili wrote:
> I'm integrating some stuff in qooxdoo like tinyMCE and Highcharts, and also
> I'm working on a new version of HtmlArea (it requires some time though). 
Sounds interesting. 

> To integrate another js library i need always a div that act as a container
> for the main object of the external library. I got a little problem with
> getDomElement().
> 
> I create an qx.html.Element("div") and i add it into the qx.html.Element of
> a widget (i get this with the getContainerElement() method).
> 
> Then i need to get the DOM Element of the qx.html.Element("div") and i use
> getDomElement(). As the documentation says this method will returns the DOM
> Element (if created) but i got always null.
All DOM elements are created lazy. Right before the widget will be added the 
DOM element is created. As long as the "appear" event is *not* fired the DOM 
element is null.

> So i've used the getDomElement when the "appear" Event of the widget is
> fired, and doing this the DOM Element is created. BUT i would like to know
> if there's another way to capture when the DOM Element is created, because
> if i try to manipulate the external library BEFORE the appear event is
> fired i still get a null (obviusly).
> 
> *So there's a way to capture a load event or a ready event for get the DOM
> Element with getDomElement() ? Or a way to be sure that the DOM Element is
> created in the contructor ?
> *
I guess the easiest way would be to subclass "qx.core.Widget" and overwrite 
the "_createContainerElement" method. You can create an own instance of 
"qx.html.Element". This instance is a subclass of "qx.html.Element" which 
overwrites the "_createDomElement" method.
By subclassing and overwriting both points you can exactly control what is 
created. You only have to make sure that the necessary attributes are set so 
the widget will act right. Take a look at the existing code of 
"_createContainerElement" in "qx.ui.core.Widget" and "_createDomElement" in 
"qx.html.Element" to get an idea of what to set.

Regards,
  Alex

--
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
___
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel