I have a dataset

  <dataset name="result">
    <value id="day">13</value>
    <value id="month">01</value>
    <value id="year">2009</value>
  </dataset>

and a <text/> field. Binding the textfield to a single value (e.g.
just day) I worked out.
But what I need the text field to be a composite of all the 3 values.

My idea was to bind the text field to the dataset and in a handler
update the text. Something along the lines of

    <text datapath="result:/">
        <handler name="ondata">
            Debug.write('data has changed');
            var day = ...
            var month = ...
            var year = ...
            this.setAttribute('text', day + '.' + month + '.' + year);
        </handler>
    </text>

But there are two problems:

a) this is only getting called once. (wrong datapath? do I need to
bind against all 3 nodes?)
b) how can I query a value from a dataset in javascript??

                var day = this.xpathQuery("result:/val...@id='day']");
                var month = result.xpathQuery("/val...@id='month']");

Neither of the two approaches worked.

Any pointers?

cheers
--
Torsten

Reply via email to