blob: 60f09a6d2562b9643d9e207c3abbe09b45ead575 [file] [log] [blame]
<?xml version="1.0"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- Cocoon Forms binding used to edit a TaskBean -->
<fb:context
id="form"
xmlns:fb="http://apache.org/cocoon/forms/1.0#binding"
xmlns:fd="http://apache.org/cocoon/forms/1.0#definition"
path="/" >
<!-- map Form widgets to the corresponding fields in the java beans -->
<fb:value id="taskId" path="id" direction="load"/>
<fb:value id="taskName" path="taskName"/>
<fb:value id="assignedTo" path="assignedTo"/>
<!-- One-to-many relationship between TaskBean and TaskCommentBean -->
<!-- Forms repeater requires unique identification mechanism of the row-nodes -->
<fb:repeater id="comments"
parent-path="."
row-path="comments"
>
<fb:identity>
<fb:value id="id" path="@id" direction="load"/>
</fb:identity>
<fb:on-bind>
<!-- executed on updates AND right after the insert -->
<fb:value id="date" path="date"/>
<fb:value id="comment" path="comment"/>
</fb:on-bind>
<fb:on-delete-row>
<fb:delete-node/>
</fb:on-delete-row>
<fb:on-insert-row>
<fb:insert-bean
classname="org.apache.cocoon.samples.tour.beans.TaskCommentBean"
addmethod="addComment"/>
</fb:on-insert-row>
</fb:repeater>
</fb:context>