cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Antonio Gallardo" <agalla...@agsoftware.dnsalias.com>
Subject [Woody-binding] wb:repeater unique-path
Date Wed, 05 Nov 2003 17:51:47 GMT
Hi:

I am trying to do a "form.save(bean)" from an empty displayed form.I have
2 days with this sample and still not working. :-(


My problem is that inside the "repeater" there is only 1 value (res_id) of
datatype integer.

Binding just save the first 2 values and an empty repeater.

BTW, A question why we need to define the unique-path attribute as
"@res_id" AFAIK, a collection cannot have an attribute called res_id.
Please explain. :-D

Best Regards,

Antonio Gallardo

Here is the binding:

<wb:context xmlns:wb="..." path="/">
  <wb:value id="rol_name" path="rol_name"/>
  <wb:value id="rol_enable" path="rol_enable"/>
  <wb:repeater id="resource" parent-path="."
    row-path="auth_permissionList" unique-row-id="res_id"
    unique-path="@res_id">
      <wb:on-bind>
          <wb:value id="res_id" path="res_id"/>
      </wb:on-bind>
      <wb:on-delete-row>
          <wb:delete-node/>
      </wb:on-delete-row>

      <wb:on-insert-row>
          <wb:insert-bean classname="test.Auth_permission"
              addmethod="addAuth_permission"/>
        </wb:on-insert-row>
    </wb:repeater>
</wb:context>

The Bean is:

public class Auth_role implements java.io.Serializable
{

   private Integer    rol_id;
   private String     rol_name;
   private Boolean    rol_enable;
  //---------------------------------------------------------------------------

   /* Getters and Setters

   //---------------------------------------------------------------------------

   private Collection auth_user_roleList = new ArrayList();

/* Getters and Setters */

//---------------------------------------------------------------------------

   private Collection auth_permissionList = new ArrayList();

   public Collection getAuth_permissionList() { return auth_permissionList;}

   public void setAuth_permissionList(Collection c) {
this.auth_permissionList = c;}

   public void addAuth_permission( Auth_permission auth_permission )
   {
      auth_permission.setAuth_role(this);
      auth_permissionList.add( auth_permission );
   }
}




Mime
View raw message