Unable to setvalue

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

Unable to setvalue

Hank Ratzesberger

Well....I'm stuck.  I want to edit from what is presented as a list  
of "things."

When the row is selected and the Edit button pressed, I attempt to  
copy values from
the row item instance to the instance used to edit.

Attached is a file that mostly works in the xforms sandbox and has
the details of the instances, but basically, I don't understand why I  
can't
copy a value from one instance to another. Especially when the ref=""  
and value=""
work as expected in the xforms inspector widget to evaluate their  
xpath.  And
there are no reported errors.

<xforms:trigger id="sensor-changes-edit">
  <xforms:label>Edit</xforms:label>
  <xforms:action ev:event="DOMActivate">
   <xforms:setvalue ref="instance('sensor-change')/change/date"    
value="instance('sensor-changes')/changes/change[index('list-
repeat')]/date" />
....
  </xforms:action>
</xforms:trigger>

Any ideas welcome, thanks.

--Hank






Hank Ratzesberger
NEES@UCSB
Institute for Crustal Studies,
University of California, Santa Barbara
805-893-8042







--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws

test.xhtml (9K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Unable to setvalue

Nafise

How about checking the addresses with <xforms:output ../> in your page to make sure if the paths are correct.

Nafise


Hank Ratzesberger wrote
Well....I'm stuck.  I want to edit from what is presented as a list  
of "things."

When the row is selected and the Edit button pressed, I attempt to  
copy values from
the row item instance to the instance used to edit.

Attached is a file that mostly works in the xforms sandbox and has
the details of the instances, but basically, I don't understand why I  
can't
copy a value from one instance to another. Especially when the ref=""  
and value=""
work as expected in the xforms inspector widget to evaluate their  
xpath.  And
there are no reported errors.

<xforms:trigger id="sensor-changes-edit">
  <xforms:label>Edit</xforms:label>
  <xforms:action ev:event="DOMActivate">
   <xforms:setvalue ref="instance('sensor-change')/change/date"    
value="instance('sensor-changes')/changes/change[index('list-
repeat')]/date" />
....
  </xforms:action>
</xforms:trigger>

Any ideas welcome, thanks.

--Hank


 




Hank Ratzesberger
NEES@UCSB
Institute for Crustal Studies,
University of California, Santa Barbara
805-893-8042







--
You receive this message as a subscriber of the ops-users@ow2.org mailing list.
To unsubscribe: mailto:ops-users-unsubscribe@ow2.org
For general help: mailto:sympa@ow2.org?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Unable to setvalue

Hank Ratzesberger

This helped.

I realized I could shorten things a bit because I was within an
<xforms:group> element.

However, while this works:

<xforms:output value="instance('sensor-change')/lat"/>
<xforms:output value="/changes/change[index('list-repeat')]/lat"/>

This does not:

<xforms:setvalue ref="instance('sensor-change')/lat" value="/changes/
change[index('list-repeat')]/lat" />

A fixed value="" does work, however, so I really am puzzled why it's  
so tricky
to copy from one instance to another.

Cheers,
Hank


On Jan 15, 2008, at 11:02 PM, Nafise wrote:

>
>
> How about checking the addresses with <xforms:output ../> in your  
> page to
> make sure if the paths are correct.
>
> Nafise
>
>
>
> Hank Ratzesberger wrote:
>>
>>
>> Well....I'm stuck.  I want to edit from what is presented as a list
>> of "things."
>>
>> When the row is selected and the Edit button pressed, I attempt to
>> copy values from
>> the row item instance to the instance used to edit.
>>
>> Attached is a file that mostly works in the xforms sandbox and has
>> the details of the instances, but basically, I don't understand why I
>> can't
>> copy a value from one instance to another. Especially when the ref=""
>> and value=""
>> work as expected in the xforms inspector widget to evaluate their
>> xpath.  And
>> there are no reported errors.
>>
>> <xforms:trigger id="sensor-changes-edit">
>>   <xforms:label>Edit</xforms:label>
>>   <xforms:action ev:event="DOMActivate">
>>    <xforms:setvalue ref="instance('sensor-change')/change/date"
>> value="instance('sensor-changes')/changes/change[index('list-
>> repeat')]/date" />
>> ....
>>   </xforms:action>
>> </xforms:trigger>
>>
>> Any ideas welcome, thanks.
>>
>> --Hank
>>
>>
>>
>>
>>
>>
>>
>> Hank Ratzesberger
>> NEES@UCSB
>> Institute for Crustal Studies,
>> University of California, Santa Barbara
>> 805-893-8042
>>
>>
>>
>>
>>
>>
>>
>> --
>> You receive this message as a subscriber of the [hidden email]  
>> mailing
>> list.
>> To unsubscribe: mailto:[hidden email]
>> For general help: mailto:[hidden email]?subject=help
>> OW2 mailing lists service home page: http://www.ow2.org/wws
>>
>>
>
> --
> View this message in context: http://www.nabble.com/Unable-to- 
> setvalue-tp14854811p14870808.html
> Sent from the ObjectWeb OPS - Users mailing list archive at  
> Nabble.com.
>
>
> --
> You receive this message as a subscriber of the [hidden email]  
> mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> OW2 mailing lists service home page: http://www.ow2.org/wws
Hank Ratzesberger
NEES@UCSB
Institute for Crustal Studies,
University of California, Santa Barbara
805-893-8042







--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Unable to setvalue

Hank Ratzesberger

Attached is a working examples, sorry but I attached the wrong file  
in my
original post.  Scan for "HERE" and you' will get to code in question.

put this in the xforms sandbox, click on any row, then on "Edit" and
the row data should be copied to the form data.  Near the bottom of the
page are two <output>'s that both work.

It just seems to me that if
<xforms:output value="/xpath"/> works, and if
<xforms:setvalue ref="myref" value="1.0"/> also works, then
<xforms:setvalue ref="myref" value="/xpath" should also work.

I other words, a hard coded value works, but an xpath
does not, but the same xpath works in the <output> element.

I checked that the instances have no namespace.

But it seems so simple that I can't believe it is a bug.
(or maybe I should take up the <copy> offer ;)

Regards,
Hank





Hank Ratzesberger
NEES@UCSB
Institute for Crustal Studies,
University of California, Santa Barbara
805-893-8042







--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws

test.xhtml (22K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Unable to setvalue

Alessandro Vernet
Administrator
Hank,

On Jan 17, 2008 2:14 PM, Hank Ratzesberger <[hidden email]> wrote:
> I checked that the instances have no namespace.

Like you said, in general, when I have a problem like this, it is
because of namespaces. Erik loves to make fun of me for this when it
happens ;). But, in this case it is different:

1. The value is evaluated relative to the ref. So since your ref is
updating instance('sensor-change'), you need to use
instance('sensor-changes') in the value attribute.
2. It is not instance('sensor-change')/change/date but
instance('sensor-change')/date as instance already returns the root
element (instead of the document node).

So here you go; you will want to write something like:

<xforms:setvalue ref="instance('sensor-change')/date"
        value="instance('sensor-changes')/change[index('list-repeat')]/date"/>

Alex
--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
http://www.orbeon.com/


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Unable to setvalue

Hank Ratzesberger
Alex,

Well, I suppose some fun is due for this mistake, or a ruler on  
knuckles.

I had caught my error on the ref (in the real code), not assuming the  
root element,
but I had not understood value is relative to ref -- I presumed it was
relative to the <group ref="">

Thank you,
Hank


On Jan 17, 2008, at 7:27 PM, Alessandro Vernet wrote:

> Hank,
>
> On Jan 17, 2008 2:14 PM, Hank Ratzesberger <[hidden email]>  
> wrote:
>> I checked that the instances have no namespace.
>
> Like you said, in general, when I have a problem like this, it is
> because of namespaces. Erik loves to make fun of me for this when it
> happens ;). But, in this case it is different:
>
> 1. The value is evaluated relative to the ref. So since your ref is
> updating instance('sensor-change'), you need to use
> instance('sensor-changes') in the value attribute.
> 2. It is not instance('sensor-change')/change/date but
> instance('sensor-change')/date as instance already returns the root
> element (instead of the document node).
>
> So here you go; you will want to write something like:
>
> <xforms:setvalue ref="instance('sensor-change')/date"
>         value="instance('sensor-changes')/change[index('list-
> repeat')]/date"/>
>
> Alex
> --
> Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
> http://www.orbeon.com/
>
> --
> You receive this message as a subscriber of the [hidden email]  
> mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> OW2 mailing lists service home page: http://www.ow2.org/wws
Hank Ratzesberger
NEES@UCSB
Institute for Crustal Studies,
University of California, Santa Barbara
805-893-8042







--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws