cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joerg Heinicke <joerg.heini...@gmx.de>
Subject Re: [CForms] Losing identity values in repeater. Please help!
Date Wed, 01 Dec 2004 01:54:40 GMT
On 01.12.2004 00:25, H.vanderLinden@MI.unimaas.nl wrote:

> I finally have my repeater working, but now something odd happens: I loose
> the value of the widget that is defined as identity, which results in all
> existing rows being added as "new". I suppose I'm doing something wrong, but
> I cannot figure out what.

Yes, and this time it's more clear and easier to fix :-)

> But, if I display the identity widget with styling="output" the identities
> get lost again.
> 
> What's wrong?

The usage of fd:field for ID implies the submit of request parameter ID 
that's read. As there is no request param sent when using 
styling="output" (only text is generated, no inputs) the new value is 
'null'. I use the ID stuff myself really often, but have done it always 
using fd:output, as this does not expect a request param and the ID is 
preserved.

>                 <fd:field id="ID">
>                     <fd:label>ID</fd:label>
>                     <fd:datatype base="string"/>
>                 </fd:field>

=> <fd:output id="ID">

>    <fb:repeater id="appointments" parent-path="."
> row-path="lists/appointments">
>       <fb:identity>
>          <fb:value id="ID" path="id"/>

Additionally I have added direction="save" to my ID fields, so that they 
can not even overwritten in flowscript. On the beans themselves I do not 
even have a setter for id, as only the database sets the id and nobody 
should manipulate them.

Joerg

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message