Joerg Heinicke <joerg.heinicke <at> gmx.de> writes:

> 
> On 06.07.2004 17:21, Nicole Hochleiter wrote:
> 
> > In stepping through org.apache.cocoon.forms.binding.RepeaterJXPathBinding 
> > public void doSave(Widget frmModel, JXPathContext jxpc) throws 
BindingException
> > 
> > I got the impression, that my new added element overwrites an existing one.
> > 
> > I'm working with bean binding, cocoon.2.1.5, Java 1.4.2.
> > 
> > Is it a bug or did I miss something in the configuration?
> > 
> > I got the idea that this is a bug, because I could fix this 'bug' in my 
special
> > case in putting some lines into that class,  like:
> > (but I do not want to keep it)
> 
> ...
> 
> > Is it really a bug or can I fix my problem in configuring something?
> 
> I had no look into your patch, but for me repeater binding works without 
> any patch, so it's probably a misconfiguration in your binding file.
> 
> Joerg
> 
In my binding file I configured the repeater as follows:
  <fb:repeater id="structureUser"
               parent-path="."
               row-path="user">

    <fb:identity>
      <fb:value id="id" path="id"/>
    </fb:identity>

    <fb:on-bind>
      <!-- executed on updates AND right after the insert -->
      <fb:value id="id" path="id"/>
      ...
    </fb:on-bind>

    <fb:on-delete-row>
      <fb:set-attribute name="isDeleted" value="true" />
    </fb:on-delete-row>

    <fb:on-insert-row>
      <fb:insert-bean
        classname="com.seitenbau.objectmodel.User"
        addmethod="addUser"/>
    </fb:on-insert-row>
  </fb:repeater> 

the model has something like:
    <fd:repeater id="strukturUser" initial-size="0">
      <fd:label>User</fd:label>
      <fd:widgets>
        <fd:field id="id">
          <fd:datatype base="string"/>
        </fd:field>     
[...]
        <fd:booleanfield id="select">
          <fd:label>choose</fd:label>
        </fd:booleanfield>
      </fd:widgets>
    </fd:repeater>
  
    <fd:repeater-action id="adduser" action-command="add-row"
                        repeater="strukturUser">
      <fd:label>add user</fd:label>
    </fd:repeater-action>
  
    <fd:repeater-action id="removeuser" action-command="delete-rows"
                        repeater="strukturUser" select="select">
      <fd:label>remove user</fd:label>
    </fd:repeater-action>

and my com.seitenbau.objectmodel.User bean has a getter and setter for id.
Do I miss something?

Nicole


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

Reply via email to