From: Lane S. <la...@op...> - 2003-08-01 15:02:34
|
what happens when you use {} ? Marc Palmer wrote: > > I just got, using the latest CVS source: > > org.webmacro.engine.BuildException: Error parsing template: > FileTemplate:xxxxxx (name removed) > java.lang.StringIndexOutOfBoundsException: String index out of range: -1 > > The problem seems to be related to #begin...#end handling, possibly to > do with nested directives (#set). > > If I remove my EXPLICIT #begin...#end it works fine. > > The line is marked in the template below. I will add a test case for > this. > > > #include "includes/header.wmt" > > <h2>Generator for SQL CREATE TABLE based on Metalizer Schema</h2> > > <form action="gensql.wmt" method="post"> > Schema name: <input name="$Ignition.FormFieldName.schemaName" > #if ($Ignition.FieldValue.schemaName) > value="$Ignition.FieldValue.schemaName" > #end > >> > <input type="submit" value=" Generate "> > </form> > > #if ($Ignition.FieldValue.schemaName) > <h3>SQL follows:</h3> > > #set $schema = $Ignition.getSchema($Ignition.FieldValue.schemaName) > <pre> > CREATE TABLE tablename ( > > #set $first = true > #foreach $group in $schema.FieldGroups > #begin > #foreach $fieldName in $schema.getFieldNamesInGroup($group) > #begin > #set $field = $schema.getField($fieldName) > !!!!!!!!!!!! This next line is the problem > #if ($first) #begin #set $first = false #end #else #begin , #end > $field.Name $field.DataType.Name > #end > #end > ); > </pre> > > #end > -- Lane Sharman Learn About Conga, All Java GUI Builder: http://opendoors.com/conga |