Yes! This is what I searched for. Thank you.
I think I had not thought about this solution because I'm to close to
the java and c++ world where you are not able to overwrite a method of
an existing class. You have to derive from this class and then you can
overwrite a method.
Thank you again.
Best Regards.
Fred McDavid schrieb:
You can use addProperty to do this.
Just after you include qooxdoo js, add:
<script>
/*
this gives you getXpath() and setXpath(blah) as methods in all descendants of
QxWidget
*/
QxWidget.addProperty({ name: "xpath", type : String, defaultValue : ' });
function XmlMapper()
{
QxObject.call(this);
}
QxObject.extend(QxObject,'XmlMapper');
proto.toXml = function (parentWidget,xmlnode)
{
/* do something */
};
proto.fromXml = function (parentWidget,xmlnode)
{
/* traverse tree */
};
</script>
I think this will get you where you want to go. It may be that you'd need to
include this script just after including the .js for QxWidget and just before
the source for the rest of the widgets, but I think it'll be ok so long as
it's done before anything gets instantiated.
--Fred
On Wednesday 09 November 2005 03:40 am, Dietrich Streifert wrote:
Hello everybody!
I have the need to add some user defined data to a widget. The goal
would be to have something like this:
var qx = new QxComboBox();
qx.setUserProperty('xpath','//settings/selection');
I know that I can use qx.addHtmlProperty to achieve this but I'm not
aware of the side effects.
The goal is to have a Class XmlMapper which has two methods:
fromXml(parentWidget,xmlnode)
toXml(parentWidget,xmlnode);
which traverse the widget tree starting with parentWidget and maps
values form xmlnode by evaluating the xpath expression which was set to
the widget.
This would connect the widgets value with the xml dom retrieved through
QxXmlHttpLoader realy simple.
But there may be another good solution to this needs!?!?!?
Any Ideas?
--
Mit freundlichen Grüßen
Dietrich Streifert
Visionet GmbH
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel