cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Antonio Gallardo" <agalla...@agssa.net>
Subject [CForms] Support for multipe unique-row-id in Repeater
Date Tue, 02 Mar 2004 18:49:59 GMT
OK.

It is done! Now we can write:

 <wb:repeater id="myRepeaterId" parent-path="." row-path="TheRowPath">
   <wb:unique-row>
     <wb:unique-field id="myId1" path="myId1"/>
     <wb:unique-field id="myId2" path="myId2"/>
   </wb:unique-row>
   <wb:on-bind>
     <wb:value id="myId1" path="myId1"/>
     <wb:value id="myId2" path="myId2"/>
     <wb:value id="field1" path="field1"/>
     <wb:value id="field2" path="field2"/>
   </wb:on-bind>
 </wb:repeater>

NOTE: The "old style" is also supported. You don't need to rewrite your
code. But I think we can also deprecate the old way (using attributes).

For more info see the initial mails below....

Best Regards,

Antonio Gallardo

Antonio Gallardo dijo:
> Hi Tim:
>
> Thanks for the description. Now I see to TempRepeater as a
> SimpleRpeater++. Is this correct?
>
> I am looking for a similar repeater some days ago. The problem is:
>
> I have a table with a Primary Key with more than one field. The current
> repeaters does not allow me to define a unique-id with more that one
> field. And in my case:
>
> rowNumber  id1     id2
> 1            1      1
> 2            1      2
> 3            2      1
> 4            2      2
> ....
>
> In this way I cannot choose any of the ids to be unique. The result is
> nothing is updated.
>
> I wonder if I am the only one facing this problems with CForms. I think
> other people will need this enhancement. After thinking in how to solve
> this I come to 2 posible solutions:
>
> 1- The Best: Allow repeater to define unique-row with more than 1 field.
>
> 2- Based in an special requirement: I have a fixed length of rows in the
> repeater to display and the user cannot change the number of rows. The
> user just fill data. I can call it a FixedLengthRepeater. Of course I can
> do this based on the current Simple or Temp Repeater. But I don't like the
> idea of this special purpose repeater.
>
> Back to (1), in order to allow multiple unique-ids, we need to change from
> attributes to elements: @unique-row-id and @unique-path
>
> So in this way we can write:
>
> <wb:repeater id="myRepeaterId" parent-path="." row-path="TheRowPath">
>   <wb:unique-row>
>     <wb:unique-field id="myId1" path="myId1"/>
>     <wb:unique-field id="myId2" path="myId2"/>
>   </wb:unique-row>
>   <wb:on-bind>
>     <wb:value id="myId1" path="myId1"/>
>     <wb:value id="myId2" path="myId2"/>
>     <wb:value id="field1" path="field1"/>
>     <wb:value id="field2" path="field2"/>
>   </wb:on-bind>
> </wb:repeater>
>
> WDYT?
>
> I need to have something like this for tomorrow. If this is OK. I will
> start to work right now on this.
>
> Best Regards,
>
> Antonio Gallardo
>


Mime
View raw message