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?
--
==========================================================
Fred R. McDavid, III
540-248-0838
[EMAIL PROTECTED]
BitDaddy Systems, Inc
* Complex System Design, Management, and Hosting
==========================================================
-------------------------------------------------------
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