A document has been updated:
http://cocoon.zones.apache.org/daisy/documentation/741.html
Document ID: 741
Branch: main
Language: default
Name: Union widget (unchanged)
Document Type: Document (unchanged)
Updated on: 10/12/05 2:14:46 PM
Updated by: Bruno Dumon
A new version has been created, state: publish
Parts
=====
Content
-------
This part has been updated.
Mime type: text/xml (unchanged)
File name: (unchanged)
Size: 2749 bytes (previous version: 1469 bytes)
Content diff:
(41 equal lines skipped)
</ft:union>
</pre>
--- <p>Of course, you also need to insert the case widget in the template. Use
the
--- <tt>submit-on-change</tt> option to let the union widget automatically
switch to
--- the case selected in the case widget:</p>
+++ <h1>Example</h1>
--- <pre><ft:widget id="my-case-widget">
+++ <p>Definition:</p>
+++
+++ <pre><fd:field id="testcase">
+++ <fd:datatype base="string"/>
+++ <fd:selection-list>
+++ <fd:item value="case1">Case 1</fd:item>
+++ <fd:item value="case2">Case 2</fd:item>
+++ </fd:selection-list>
+++ </fd:field>
+++
+++ <fd:union id="testunion" case="testcase">
+++ <fd:widgets>
+++ <fd:group id="case1">
+++ <fd:field id="field1">
+++ <fd:datatype base="string"/>
+++ </fd:field>
+++ <fd:field id="field2">
+++ <fd:datatype base="string"/>
+++ </fd:field>
+++ </fd:group>
+++ <fd:group id="case2">
+++ <fd:field id="field1">
+++ <fd:datatype base="long"/>
+++ </fd:field>
+++ <fd:field id="field2">
+++ <fd:datatype base="long"/>
+++ </fd:field>
+++ </fd:group>
+++ </fd:widgets>
+++ </fd:union>
+++ </pre>
+++
+++ <p>Template:</p>
+++
+++ <pre><ft:widget id="testcase">
<fi:styling list-type="dropdown" submit-on-change="true"/>
</ft:widget>
+++
+++ <ft:union id="testunion">
+++ <ft:case id="case1">
+++ <ft:group id="case1">
+++ <ft:widget id="field1"/>
+++ <ft:widget id="field2"/>
+++ </ft:group>
+++ </ft:case>
+++ <ft:case id="case2">
+++ <ft:group id="case2">
+++ <ft:widget id="field1"/>
+++ <ft:widget id="field2"/>
+++ </ft:group>
+++ </ft:case>
+++ </ft:union>
</pre>
+++ <p>Note the use of <tt>submit-on-change</tt> on the case widget to let the
union
+++ widget automatically switch when the case is changed.</p>
+++
</body>
</html>
Fields
======
no changes
Links
=====
no changes
Custom Fields
=============
no changes
Collections
===========
no changes