cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From H.vanderLin...@MI.unimaas.nl
Subject [Cforms] Correct syntax for binding bean in repeater?
Date Tue, 30 Nov 2004 17:57:55 GMT
Hi guys (and gals),

Please help, I'm fiddling with this for the last week and I cannot get it to
work properly.

Situation: I have a "bean" (it's rather complicated for a bean) that holds a
map of lists that I want to edit in a repeater. I either get nothing
displayed at all or I get it displayed but it fails to update.

What should be the correct syntax?

Childbean: appointmentBean (appointmentBean.date, appointmentBean.time,
appointmentBean.person)

Rootbean: masterBean (masterBean.lists.appointments is the list of
appointmentBean-s)

<fb:context xmlns:fb="http://apache.org/cocoon/forms/1.0#binding" path="/">
	<fb:repeater id="appointments" parent-path="."
row-path="lists/appointments">
      <fb:identity>
         <fb:value id="ID" path="id/id"/>
      </fb:identity>
      <fb:on-bind>
         <!-- executed on updates AND right after the insert -->
    	<fb:custom id="appointmentDate" path="date"/> 
    	<fb:custom id="appointmentTime" path="time"/> 
    	<fb:custom id="appointmentPerson" path="person"/> 
            
      </fb:on-bind>
      <fb:on-delete-row>
         <fb:delete-node/>
      </fb:on-delete-row>
      <fb:on-insert-row>
        <fb:insert-bean classname="AppointmentBean"
            addmethod="add" /> 
      </fb:on-insert-row>
   </fb:repeater>
</fb:context>

What I want to do is add the new appointmentBean to the list of
appointments, not to the root (i.e. masterBean). However, I need the above
syntax to get the existing appointmentBeans displayed.

If I change it into 
	<fb:repeater id="appointments" parent-path="lists/appointments"
row-path=".">

the "on-save" works, but the "on-load" doesn't do anything.

I can't think of anything else.

Thanks.

Bye, Helma

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


Mime
View raw message