cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marc Portier <>
Subject Re: [Woody] form2 XML binding example does not set id for new rows
Date Fri, 31 Oct 2003 19:56:21 GMT
nope, current binding doesn't do this.

you can: make the id visible so the user can provide it though
and you can also: loop through your form-model and set this stuff (with 
the same API the binding is using internally)

but what you describe here seems to be quite a specific kind of business 
logic, no?

my naieve suggestion would be that after binding you apply these rules 
to your model (e.g. the correct hibernate or ojb setting would do this 
while persisting)

but that is just me, we can catalog also all possible id-generation 
strategies (random uuid like, increment...) or provide an interface for 
your specific plugin class that does it... but as said I see little 
advantage over just applying this on the model in your business logic

making sense? or overlooking some essentials?
hm, maybe sylvain's event-handling additions could be used to set values 
for these?


Ugo Cei wrote:

> I'm trying to do something similar to Woody's form2 sample, adding nodes 
> to an XML document using the repeater. The problem with form2 (and also 
> with my code) is that the new nodes' "id" attribute is null, and I 
> cannot see an obvious way to set it's value. What I'd like is to set it 
> to the greates current value +1. Is this possible somehow?
>     Ugo

Marc Portier                  
Outerthought - Open Source, Java & XML Competence Support Center
Read my weblog at                        

View raw message