You are viewing a plain text version of this content. The canonical link for it is here.
Posted to docs@cocoon.apache.org by da...@cocoon.zones.apache.org on 2005/10/14 15:30:18 UTC

[DAISY] Updated: Advanced Control Flow - Velocity

A document has been updated:

http://cocoon.zones.apache.org/daisy/legacydocs/514.html

Document ID: 514
Branch: main
Language: default
Name: Advanced Control Flow - Velocity (previously Advanced Control Flow)
Document Type: Document (unchanged)
Updated on: 10/14/05 1:29:59 PM
Updated by: Helma van der Linden

A new version has been created, state: publish

Parts
=====
Content
-------
This part has been updated.
Mime type: text/xml (unchanged)
File name:  (unchanged)
Size: 2379 bytes (previous version: 2396 bytes)
Content diff:
(13 equal lines skipped)
    available as a variable named <tt>$continuation</tt>. You would typically access
    its <tt>id</tt>:</p>
    
--- <pre>
---   &lt;form action="$continuation.id"&gt;
---    </pre>
+++ <pre>  &lt;form action="$continuation.id"&gt;
+++ </pre>
    
    <p>You can also reach previous continuations by using the <tt>getParent()</tt>
    function:</p>
    
--- <pre>
---   &lt;form action="$continuation.getParent().id" &gt;
---    </pre>
+++ <pre>  &lt;form action="$continuation.getParent().id" &gt;
+++ </pre>
    
    <p>In addition the following implicit objects are always available in the
    Velocity context:</p>
(21 equal lines skipped)
    access JavaScript objects and arrays in your templates, as well as Java objects.
    For example, assuming you had a Flowscript like this:</p>
    
--- <pre>
---     sendPage("myTemplate.vm", {colors: ["red", "blue", "yellow"]});
---    </pre>
+++ <pre>    sendPage("myTemplate.vm", {colors: ["red", "blue", "yellow"]});
+++ </pre>
    
    <p>You could do this in <tt>myTemplate.vm</tt>:</p>
    
--- <pre>
---     &lt;select name="colors"&gt;
+++ <pre>    &lt;select name="colors"&gt;
        #foreach ($color in $colors) 
          &lt;option value="$color"&gt;$color&lt;/option&gt;
        #end
        &lt;/select&gt;
---     </pre>
+++ </pre>
    
    </body>
    </html>


Fields
======
no changes

Links
=====
no changes

Custom Fields
=============
no changes

Collections
===========
no changes