Joerg Heinicke <joerg.heinicke <at> gmx.de> writes:
>
> On 09.07.2004 09:19, Nicole Hochleiter wrote:
>
...
> >
> > <fb:on-bind>
> > <!-- executed on updates AND right after the insert -->
> > <fb:value id="id" path="id"/>
>
> This one duplicates the binding of fb:identity.
>
> > ...
> > </fb:on-bind>
...
> >
> > <fb:on-insert-row>
> > <fb:insert-bean
> > classname="com.seitenbau.objectmodel.User"
> > addmethod="addUser"/>
>
> This method handles the adding of new beans, so maybe you do something
> wrong there? My addObject methods mostly only look like:
>
> public void addObject(Object obj) {
> this.objects.add(obj);
> }
>
> where this.objects is a collection. I guess it's the same for you.
yes, I have sth. like this. A new object is greated (with default constructor).
The object is empty and added like in your method.
>
> > </fb:on-insert-row>
> > </fb:repeater>
> >
> Do you have the id fields in the client, maybe as hidden input? If not
> they will loose their values.
I have the id-field as a hidden field and I set the new one, if a I a new
object, because in my application the user is not allowed to create totally new
objects. The user only can choose from a list, where then the id is taken.
So first I add a new row (with hidden id field), then I fill this hidden field
with javascript and then I send the form. This is why I need the setter for id.
[...]
> >
> > and my com.seitenbau.objectmodel.User bean has a getter and setter for id.
>
> I don't have a setter at all as cforms does not generate my ids. So I
> also only have a direction="load" binding for the ids. Additionally I do
> not deliver the ids to the client and so only have an fd:output for all ids.
>
> So there are three possible sources of trouble:
> 1. fd:field vs. fd:output
> 2. (duplicate) binding for id and implicit direction="both"
> 3. addUser method
>
> Joerg
>
Now I changed the the line in <fb:on-bind>... for id to direction="save" and it
works fine. :-))
Thanks a lot!
Nicole
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]