Thanks Carlos,

You've understood what I wanted to do, but if you read a little bit further, you'll see that I met some problems to adopt this structure... :)

--
Olivier



On 31/10/2003 18:48, Carlos Chávez wrote:

Olivier Billard Escribio :-)

Hi all !

I have a problem concerning the binding in woody :

I have repeater bound with following structure :
<person id="">
  <person_id>156</person_id>
  <person_data>some data</person_data>
</person>
<person id="">
  <person_id>157</person_id>
  <person_data>other data</person_data>
</person>
...


try this organitation :

 <persons>
   <person id="156">
       ...
   </person>
   ...
 </persons>

regards,

carlos chavez.


here is the repeater binding :
<wb:repeater id="persons" parent-path="." row-path="person"
unique-row-id="id"  unique-path="@id">
  <wb:on-bind>
    <wb:value id="person_id" path="person_id" />

remove the line above



    <wb:value id="person_data" path="person_data" />
  </wb:on-bind>

  <wb:on-delete-row>
    <wb:delete-node />
   </wb:on-delete-row>

  <wb:on-insert-row>
    <wb:insert-node>
      <person id="">
        <person_id />
        <person_data />
      </person>
    </wb:insert-node>
  </wb:on-insert-row>
</wb:repeater>


and the container :


<wd:repeater id="persons">
  <wd:output id="id">
    <wd:datatype base="string"/>
  </wd:output>
  <wd:field id="person_id">
    <wd:label>ID</wd:label>
    <wd:datatype base="string"/>
  </wd:field>
  <wd:field id="person_data">
    <wd:datatype base="string"/>
  </wd:field>
</wd:repeater>


Obviously, @id and person_id play the same role, but this is the only way I get it work. When I set :

>>row-path="person_id" unique-row-id="person_id"<<
on the repeater binding, the last row added is equals to the same...

and when I bind the widget person_id to @id :
>>
  <wb:on-bind>
    <wb:value id="person_id" path="@id" />
    <wb:value id="person_data" path="person_data" />
  </wb:on-bind>
<<
I have a JXPath exception, telling that the value cannot be bound with
@id...

What is wrong ?
 - is "@id" a wrong JXPath expression ? If yes, how can I bound the
person_id widget with
the person/@id in the structure ?
 - are the attrs of the repeater binding >>row-path="person_id"
unique-row-id="person_id"<< wrong ? In this case, what is the true
syntax ?

Thanks in advance, and more if you read this mail until the end :) ...

--
Olivier BILLARD



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to