<p>I'm having difficulty using Flowscript with CForms. I've modified the cforms with flowscript sample and cannot get it to work. In the forms blocks
samples, I'm attempting to add repeater widgets to the tabs using flowscript. I'm trying to add a contact list to each tab. I've modified the form
definition to include the 2 extra examples of the contact list. There are 2 problems that I'm having, and cannot find documentation on the mailing lists or wiki.</p>
<p> 1. Extra text is diplaying between the <body> tag and <h2> tag. The text is an unformatted plain text
representation of all my labels from the form. I have not modified the stylesheets in any manner, but that appear to be where the problem lies.<br /> </p>
<p>2. I receive this error when I attempt to add/remove a row: No function nor continuation given in <map:call function>... I've cut
down on some of the validation in the definition and template!
files, but I can't see where I've cut out anything pertinent to continuations.</p> <p> </p> <p>Specifically, I don't understand the section of the sitemap where it talks about starting a flowscript scenario. How do I access the continuation? I see that it's part of the Flow Object Model, but I'm unsure how it
gets created.<br /> </p> <p> Any help would be greatly appreciated. Sorry this email is so long. I've included my definition file, template file, jscript file and relevant sitemap portions.</p> <p> </p> <p>*---------Relevant Sitemap.xmap---------*</p>
<p> <!--Edit Supervisors--><br /> <map:pipeline><br /> <map:match pattern="admin/sups/edit"><br /> <map:call
function="handleForm"><br /> <map:parameter name="function" value="edi!
tsup"/><br /> &nbs!
p;
<map:parameter name="form-definition" value="content/forms/definitions/defn_supervisor.xml"/><br /> </map:call><br /> </map:match><br /> <br /> <!-- Start a flowscript scenario --><br /> <map:match
pattern="*/**do-*.flow"><br /> <map:call function="do_{1}"/><br /> </map:match></p> <p> <!-- Continue a scenario. The continuation id is passed in the URL<br /> (typically used for GET requests)
--><br /> <map:match pattern="*/**.continue"><br /> <map:call continuation="{1}"/><br /> </map:match><br /> <br /> &n!
bsp; <!-- Continue a scenario. The continuation id is passed as a request<br /> parameter (typically used for POST request) --><br /> <map:match pattern="*/**.continue"><br /> <map:call
continuation="{request-param:continuation-id}"/><br /> </map:match><br /> <br /> <map:match pattern="*-display-pipeline.jx"><br /> <map:generate type="jx" src="content/forms/templates/tmpt_{1}.xml"
label="content1"/><br /> <map:call resource="simple-page2html"><br /> <map:parameter name="file" value="content/forms/templates/tmpt_{1}.xml"/><br /> &n!
bsp; </map:call><br /> &nb!
sp; 
; <map:transform src="style/xslt/forms-samples-styling.xsl"/><br /> <map:serialize/><br /> </map:match><br /> </map:pipeline><br /> </p> <p> </p> <p>*--------defn_editsups.xml------*</p> <p><?xml version="1.0"
encoding="utf-8" ?><br /> <br /> <fd:form xmlns:fd="http://apache.org/cocoon/forms/1.0#definition"><br /> <br /> <fd:widgets><br /> <fd:field id="tab-state"><br /> <fd:datatype base="string"/><br />
<fd:on-value-changed><br /> <javascript><br /> java.lang.System.err.println("You're getting there!");<br /> </java!
script><br /> </fd:on-value-changed><br /> </fd:field><br /> <fd:repeater id="salessups"><br /> <fd:validation><br /> <!-- This demonstrates validating a
repeater: we check here if all contacts are distinct.<br /> A repeater cannot itself display a validation error, and therefore sets a validation<br /> error on a field in the offenting row. --><br />
<fd:javascript><br /> var list = new java.util.ArrayList();<br /> var success = true;<br /> // Iterate on all ro!
ws<br />  !
; for (v
ar i = 0; i &lt; widget.size; i++) {<br /> // Get the row<br /> var row = widget.getRow(i);<br /> // Compute a key combining the
first and last name<br /> var key = row.lookupWidget("SupID").value + "/" + row.lookupWidget("name").value;<br /> if (list.contains(key)) {<br />
// already in the list<br /> row.lookupWidget("name").setValidationError(new Packages.org.apache.cocoon.forms.validation.ValidationError("Duplicate supervisor name", f!
alse));<br /> success = false;<br /> break; // no need to continue<br /> }<br /> // Add the current row's key to the
list<br /> list.add(key);<br /> }<br /> <br /> // Must return true/false<br /> return success;<br />
<br /> </fd:javascript><br /> </fd:validation><br !
/> <fd:widgets><br /> &nb!
sp; 
; <fd:field id="SupID"><br /> <fd:label>ID</fd:label><br /> <fd:datatype base="string"/><br /> </fd:field><br /> <fd:field
id="name"><br /> <fd:label>Name</fd:label><br /> <fd:datatype base="string"/><br /> </fd:field><br /> <fd:booleanfield id="select"><br />
<fd:label>Select</fd:label><br /> </fd:booleanfield><br /> &nb!
sp; </fd:widgets><br /> </fd:repeater><br /> <br /> <fd:repeater-action id="addsupsales" command="add-row" repeater="salessups"><br /> <fd:label>Add supervisor</fd:label><br />
</fd:repeater-action><br /> <br /> <fd:repeater-action id="removesupervisorsales" command="delete-rows" repeater="salessups" select="select"><br /> <fd:label>Remove selected supervisors</fd:label><br />
</fd:repeater-action><br /> <br /> <fd:repeater id="hlasups"><br /> <fd:validation><br /> <!-- This demonstrates validating a repeater: we check here if all contacts are distinct.<br /!
> !
A repea
ter cannot itself display a validation error, and therefore sets a validation<br /> error on a field in the offenting row. --><br /> <fd:javascript><br /> var list = new java.util.ArrayList();<br />
var success = true;<br /> // Iterate on all rows<br /> for (var i = 0; i &lt; widget.size; i++) {<br /> // Get
the row<br /> var row = widget.getRow(i);<br /> // Compute a key combining the first and last name<br /> !
var key = row.lookupWidget("firstname").value + "/" + row.lookupWidget("lastname").value;<br /> if (list.contains(key)) {<br /> // already in the list<br />
row.lookupWidget("firstname").setValidationError(new Packages.org.apache.cocoon.forms.validation.ValidationError("Duplicate contact name", false));<br /> success = false;<br />
break; // no need to continue<br /> }<br /> // Add the c!
urrent row's key to the list<br /> &nb!
sp; 
; list.add(key);<br /> }<br /> <br /> // Must return true/false<br /> return success;<br /> <br />
</fd:javascript><br /> </fd:validation><br /> <fd:widgets><br /> <fd:field id="SupID"><br /> <fd:label>ID</fd:label><br />
<fd:datatype base="string"/><br /> </fd:field><br /> &nbs!
p; <fd:field id="name"><br /> <fd:label>Name</fd:label><br /> <fd:datatype base="string"/><br /> </fd:field><br /> <fd:booleanfield
id="select"><br /> <fd:label>Select</fd:label><br /> </fd:booleanfield><br /> </fd:widgets><br /> </fd:repeater><br /> <br /> <fd:repeater-action id="addsuphla"
command="add-row" repeater="hlasups"><br /> <fd:label>Add supervisor</fd:label><br /> </fd:repeater-action><br /> <br /> &nbs!
p; <fd:repeater-action id="removesuperviso!
rhla&quo
t; command="delete-rows" repeater="hlasups" select="select"><br /> <fd:label>Remove selected supervisors</fd:label><br /> </fd:repeater-action><br /> <br /> <fd:repeater id="closersups"><br />
<fd:validation><br /> <!-- This demonstrates validating a repeater: we check here if all contacts are distinct.<br /> A repeater cannot itself display a validation error, and therefore sets a validation<br />
error on a field in the offenting row. --><br /> <fd:javascript><br /> var list = new java.util.ArrayList();<br /> &!
nbsp; var success = true;<br /> // Iterate on all rows<br /> for (var i = 0; i &lt; widget.size; i++) {<br /> // Get the row<br />
var row = widget.getRow(i);<br /> // Compute a key combining the first and last name<br /> var key = row.lookupWidget("firstname").value + "/" +
row.lookupWidget("lastname").value;<br /> if (list.contains(key)) {<br /> // already in the list<br /> &nb!
sp; row.lookupWidget("first!
name&quo
t;).setValidationError(new Packages.org.apache.cocoon.forms.validation.ValidationError("Duplicate contact name", false));<br /> success = false;<br /> break; // no need to continue<br />
}<br /> // Add the current row's key to the list<br /> list.add(key);<br /> }<br />
<br /> // Must return true/false<br /> return success;<br /> <br /> !
</fd:javascript><br /> </fd:validation><br /> <fd:widgets><br /> <fd:field id="SupID"><br /> <fd:label>ID</fd:label><br />
<fd:datatype base="string"/><br /> </fd:field><br /> <fd:field id="name"><br /> <fd:label>Name</fd:label><br />
<fd:datatype base="string"/><br /> </fd:field><br /> <fd:booleanfield id="select"><br!
/> <!
;fd:labe
l>Select</fd:label><br /> </fd:booleanfield><br /> </fd:widgets><br /> </fd:repeater><br /> <br /> <br /> <fd:repeater-action id="addsupcloser" command="add-row"
repeater="closersups"><br /> <fd:label>Add supervisor</fd:label><br /> </fd:repeater-action><br /> <br /> <fd:repeater-action id="removesupervisorcloser" command="delete-rows" repeater="closersups" select="select"><br />
<fd:label>Remove selected supervisors</fd:label><br /> </fd:repeater-action><br /> </fd:widgets><br /> <br /> </fd:form></p> <p> </p> <p>*----------temp_editsups.xml---------*</p> <p> <!
;?xml version="1.0" encoding="utf-8" ?><br /> <br /> <page xmlns:ft="http://apache.org/cocoon/forms/1.0#template"<br /> xmlns:fi="http://apache.org/cocoon/forms/1.0#instance"<br />
xmlns:jx="http://apache.org/cocoon/templates/jx/1.0"><br /> <br /> <!-- Import the macros that define CForms template elements --><br /> <jx:import uri="resource://org/apache/cocoon/forms/generation/jx-macros.xml"/><br /> <br />
<title>Supervisors Administration Form</title><br /> <content><br /> <!--<ft:form-template action="editsups" method="POST">--><br /> <ft:form-template action="#{$cocoon/continuation/id}.continue"
method="POST"><br /> <div!
style="width: 90%; margin: 10px 50px 50px 50px;">!
;<br />
<br /> <!-- grouping supervisor lists, one for each team --><br /> <fi:group><br /> <br /> <fi:styling type="choice"/><br /> <fi:label>Select a team: </fi:label><br /> <fi:state><br /> <ft:widget id="tab-state"/><br /> </fi:state><br /> <br /> <fi:items><br /> <fi:group name="salessups"><br /> <fi:label>Sales</fi:label><br /> <fi:styling layout="columns"/><br /> <fi:items&!
gt;<br /> <ft:widget-label id="salessups"/><br/><br /> <ft:repeater-size id="salessups"/><br /> <table border="1"><br />
<tr><br /> <th><ft:repeater-widget-label id="salessups" widget-id="SupID"/></th><br />
<th><ft:repeater-widget-label id="salessups" widget-id="name"/></th><br /> !
<th><ft:repeate!
r-widget
-label id="salessups" widget-id="select"/></th><br /> </tr><br /> <jx:choose><br />
<jx:when test="${widget.getChild('salessups').getSize() == 0}"><br /> <tr><td colspan="6" align="center"><em>There are no Sales supervisors to display</em></td></tr><br />
</jx:when><br /> <jx:otherwis!
e><br /> <!-- The contents of the repeater-widget element is a template that will<br /> be applied to each row in the repeater. --><br />
<ft:repeater-widget id="salessups"><br /> <tr><br />
<td><ft:widget id="SupID"/></td><br /> &nbs!
p; <td>&!
lt;ft:wi
dget id="name"/></td><br /> <td><ft:widget id="select"/></td><br /> </tr><br />
</ft:repeater-widget><br /> </jx:otherwise><br /> </jx:choose><br />
<tr><br />  !
; <td colspan="6"><br /> <ft:widget id="addsupsales"/><br /> <jx:if test="${widget.getChild('salessups').getSize() > 0}"><br />
<ft:widget id="removesupervisorsales"/><br /> <br/><br />
</jx:if><br /> </td><br /> !
 !
; &
nbsp; </tr><br /> </table><br /> <input type="submit"/><br /> </fi:items><br /> </fi:group><br />
</fi:items><br /> <br /> <fi:items><br /> <fi:group name="hlasups"><br /> <fi:label>HLAs</fi:label><br /> <fi:styling layout="columns"/><br />
<fi:items><br /> <ft:widget-label id="hlasups"/><br/&!
gt;<br /> <ft:repeater-size id="hlasups"/><br /> <table border="1"><br /> <tr><br />
<th><ft:repeater-widget-label id="hlasups" widget-id="SupID"/></th><br /> <th><ft:repeater-widget-label id="hlasups"
widget-id="name"/></th><br /> <th><ft:repeater-widget-label id="hlasups" widget-id="select"/&!
gt;</th><br /> &nbs!
p;  
; </tr><br /> <jx:choose><br /> <jx:when test="${widget.getChild('hlasups').getSize() == 0}"><br />
<tr><td colspan="6" align="center"><em>There are no HLA supervisors to display</em></td></tr><br /> </jx:when><br />
<jx:otherwise><br /> <!-- The contents of !
the repeater-widget element is a template that will<br /> be applied to each row in the repeater. --><br /> <ft:repeater-widget id="hlasups"><br />
<tr><br /> <td><ft:widget id="SupID"/></td><br />
<td><ft:widget id="name"/></td><br /> &nb!
sp; &n!
bsp;&nbs
p; <td><ft:widget id="select"/></td><br /> </tr><br /> </ft:repeater-widget><br />
</jx:otherwise><br /> </jx:choose><br /> <tr><br /> <td
colspan="6"><br /> &nbs!
p; <ft:widget id="addsuphla"/><br /> <jx:if test="${widget.getChild('hlasups').getSize() > 0}"><br /> <ft:widget
id="removesupervisorhla"/><br /> <br/><br /> </jx:if><br />
</td><br /> </tr><br /> !
</table><br /> &nb!
sp; 
; <input type="submit"/><br /> </fi:items><br /> </fi:group><br /> </fi:items><br /> <br /> <fi:items><br />
<fi:group name="closersups"><br /> <fi:label>Closers</fi:label><br /> <fi:styling layout="columns"/><br /> <fi:items><br />
<ft:widget-label id="closersups"/><br/><br /> <ft:repeater-size id="closersup!
s"/><br /> <table border="1"><br /> <tr><br /> <th><ft:repeater-widget-label
id="closersups" widget-id="SupID"/></th><br /> <th><ft:repeater-widget-label id="closersups" widget-id="name"/></th><br />
<th><ft:repeater-widget-label id="closersups" widget-id="select"/></th><br /> </tr><br!
/> &n!
bsp; &nb
sp; <jx:choose><br /> <jx:when test="${widget.getChild('closersups').getSize() == 0}"><br /> <tr><td colspan="6"
align="center"><em>There are no Closer supervisors to display</em></td></tr><br /> </jx:when><br /> <jx:otherwise><br />
<!-- The contents of the repeater-widget element is a template that will<br /> &nb!
sp; be applied to each row in the repeater. --><br /> <ft:repeater-widget id="closersups"><br />
<tr><br /> <td><ft:widget id="SupID"/></td><br /> <td><ft:widget
id="name"/></td><br /> !
<td><ft:widget id="select"/></td>!
<br /> &
nbsp; </tr><br /> </ft:repeater-widget><br /> </jx:otherwise><br />
</jx:choose><br /> <tr><br /> <td colspan="6"><br />
<ft:widget id="addsupcloser"/><br /> &n!
bsp; <jx:if test="${widget.getChild('closersups').getSize() > 0}"><br /> <ft:widget id="removesupervisorcloser"/><br />
<br/><br /> </jx:if><br /> </td><br />
</tr><br /> </table><br /> &n!
bsp; <input type="submit"/><br />!
&
nbsp; </fi:items><br /> </fi:group><br /> </fi:items><br /> <br /> <br />
</fi:group><br /> <br /> </div><br /> </ft:form-template><br /> </content><br /> </page></p> <p> </p> <p>*----------forms_editsups_flow.js----------*</p> <p><br /> cocoon.load("resource://org/apache/cocoon/forms/flow/javascript/Form.js");<br /> <br /> function editsup(form) {<br />
var model = form.getModel();<br /> <br /> model.salessups[0].name = "Jules";<br /> model.salessups[1].name = "Lucien";<br /> model.salessups[2].name = "Chris";<b!
r /> <br /> form.showForm("editsup-display-pipeline.jx");<br /> print("submitId = " + form.submitId);<br />
<br /> // also store the form as a request attribute as the XSP isn't flow-aware<br /> cocoon.request.setAttribute("editsup",
form.getWidget());<br /> cocoon.sendPage("editsup-success-pipeline.xsp");<br /> } <br /> </p>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]