bug 2622:The valiadtor Javascript object was being intialised before the onload function, when there was no DOM available. Consequently it was faling (silently). Fixed. At the same time I have removed an obsolete and misleading comment from the generated controller code, and made some other minor fixes to generated views.
This commit is contained in:
parent
d2d9af3cfc
commit
2b04dac72f
|
@ -9,8 +9,8 @@
|
||||||
Transform ADL into (partial) controller classes
|
Transform ADL into (partial) controller classes
|
||||||
|
|
||||||
$Author: sb $
|
$Author: sb $
|
||||||
$Revision: 1.28 $
|
$Revision: 1.29 $
|
||||||
$Date: 2009-02-19 15:29:27 $
|
$Date: 2009-02-20 15:25:29 $
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<!-- WARNING WARNING WARNING: Do NOT reformat this file!
|
<!-- WARNING WARNING WARNING: Do NOT reformat this file!
|
||||||
|
@ -70,7 +70,7 @@
|
||||||
//
|
//
|
||||||
// Automatically generated abstract super class for controllers for the
|
// Automatically generated abstract super class for controllers for the
|
||||||
// <xsl:value-of select="/adl:application/@name"/> application; generated using
|
// <xsl:value-of select="/adl:application/@name"/> application; generated using
|
||||||
// adl2controllerclasses.xslt version <xsl:value-of select="substring( '$Revision: 1.28 $', 10)"/>
|
// adl2controllerclasses.xslt version <xsl:value-of select="substring( '$Revision: 1.29 $', 10)"/>
|
||||||
//
|
//
|
||||||
// <xsl:value-of select="/adl:application/@revision"/>
|
// <xsl:value-of select="/adl:application/@revision"/>
|
||||||
//
|
//
|
||||||
|
@ -180,7 +180,7 @@
|
||||||
//
|
//
|
||||||
// Controller for auto-generated forms for editing <xsl:value-of select="@name"/>s
|
// Controller for auto-generated forms for editing <xsl:value-of select="@name"/>s
|
||||||
// Automatically generated from application description using
|
// Automatically generated from application description using
|
||||||
// adl2controllerclasses.xslt version <xsl:value-of select="substring( '$Revision: 1.28 $', 10)"/>
|
// adl2controllerclasses.xslt version <xsl:value-of select="substring( '$Revision: 1.29 $', 10)"/>
|
||||||
//
|
//
|
||||||
// This file is automatically generated; DO NOT EDIT IT.
|
// This file is automatically generated; DO NOT EDIT IT.
|
||||||
//
|
//
|
||||||
|
@ -230,9 +230,6 @@
|
||||||
]
|
]
|
||||||
public partial class <xsl:value-of select="concat( @name, 'Controller')"/> : <xsl:value-of select="concat( 'Abstract', /adl:application/@name, 'Controller')"/> {
|
public partial class <xsl:value-of select="concat( @name, 'Controller')"/> : <xsl:value-of select="concat( 'Abstract', /adl:application/@name, 'Controller')"/> {
|
||||||
|
|
||||||
/* The SmartFormHelper stuff in generated controller classes does not yet work. There is some
|
|
||||||
* hope that in future it will offer definite benefits and in the mean time it is doing no harm.
|
|
||||||
* However if you are looking for bugs look elsewhere - this is not currently used */
|
|
||||||
protected class <xsl:value-of select="concat( @name, 'FieldHelper')"/> : SmartFormHelper {
|
protected class <xsl:value-of select="concat( @name, 'FieldHelper')"/> : SmartFormHelper {
|
||||||
public <xsl:value-of select="concat( @name, 'FieldHelper')"/>() {
|
public <xsl:value-of select="concat( @name, 'FieldHelper')"/>() {
|
||||||
<xsl:for-each select="descendant::adl:property[@type='entity']">
|
<xsl:for-each select="descendant::adl:property[@type='entity']">
|
||||||
|
|
|
@ -15,8 +15,8 @@
|
||||||
Transform ADL into velocity view templates
|
Transform ADL into velocity view templates
|
||||||
|
|
||||||
$Author: sb $
|
$Author: sb $
|
||||||
$Revision: 1.30 $
|
$Revision: 1.31 $
|
||||||
$Date: 2009-02-20 10:31:03 $
|
$Date: 2009-02-20 15:25:29 $
|
||||||
-->
|
-->
|
||||||
<!-- WARNING WARNING WARNING: Do NOT reformat this file!
|
<!-- WARNING WARNING WARNING: Do NOT reformat this file!
|
||||||
Whitespace (or lack of it) is significant! -->
|
Whitespace (or lack of it) is significant! -->
|
||||||
|
@ -124,7 +124,7 @@
|
||||||
Auto generated Velocity maybe-delete form for <xsl:value-of select="@name"/>,
|
Auto generated Velocity maybe-delete form for <xsl:value-of select="@name"/>,
|
||||||
generated from ADL.
|
generated from ADL.
|
||||||
|
|
||||||
Generated using adl2views.xslt <xsl:value-of select="substring( '$Revision: 1.30 $', 10)"/>
|
Generated using adl2views.xslt <xsl:value-of select="substring( '$Revision: 1.31 $', 10)"/>
|
||||||
</xsl:comment>
|
</xsl:comment>
|
||||||
<xsl:call-template name="maybe-delete">
|
<xsl:call-template name="maybe-delete">
|
||||||
<xsl:with-param name="entity" select="."/>
|
<xsl:with-param name="entity" select="."/>
|
||||||
|
@ -161,7 +161,7 @@
|
||||||
Auto generated Velocity maybe-delete form for <xsl:value-of select="@name"/>,
|
Auto generated Velocity maybe-delete form for <xsl:value-of select="@name"/>,
|
||||||
generated from ADL.
|
generated from ADL.
|
||||||
|
|
||||||
Generated using adl2views.xslt <xsl:value-of select="substring( '$Revision: 1.30 $', 10)"/>
|
Generated using adl2views.xslt <xsl:value-of select="substring( '$Revision: 1.31 $', 10)"/>
|
||||||
|
|
||||||
<xsl:value-of select="/adl:application/@revision"/>
|
<xsl:value-of select="/adl:application/@revision"/>
|
||||||
</xsl:comment>
|
</xsl:comment>
|
||||||
|
@ -244,7 +244,7 @@
|
||||||
Auto generated Velocity <xsl:value-of select="@name"/> form for <xsl:value-of select="ancestor::adl:entity/@name"/>,
|
Auto generated Velocity <xsl:value-of select="@name"/> form for <xsl:value-of select="ancestor::adl:entity/@name"/>,
|
||||||
generated from ADL.
|
generated from ADL.
|
||||||
|
|
||||||
Generated using adl2views.xslt <xsl:value-of select="substring( '$Revision: 1.30 $', 10)"/>
|
Generated using adl2views.xslt <xsl:value-of select="substring( '$Revision: 1.31 $', 10)"/>
|
||||||
Generation parameters were:
|
Generation parameters were:
|
||||||
locale: <xsl:value-of select="$locale"/>
|
locale: <xsl:value-of select="$locale"/>
|
||||||
generate-site-navigation: <xsl:value-of select="$generate-site-navigation"/>
|
generate-site-navigation: <xsl:value-of select="$generate-site-navigation"/>
|
||||||
|
@ -320,7 +320,7 @@
|
||||||
Auto generated Velocity form for <xsl:value-of select="ancestor::adl:entity/@name"/>,
|
Auto generated Velocity form for <xsl:value-of select="ancestor::adl:entity/@name"/>,
|
||||||
generated from ADL.
|
generated from ADL.
|
||||||
|
|
||||||
Generated using adl2views.xsl <xsl:value-of select="substring( '$Revision: 1.30 $', 10)"/>
|
Generated using adl2views.xsl <xsl:value-of select="substring( '$Revision: 1.31 $', 10)"/>
|
||||||
Generation parameters were:
|
Generation parameters were:
|
||||||
locale: <xsl:value-of select="$locale"/>
|
locale: <xsl:value-of select="$locale"/>
|
||||||
generate-site-navigation: <xsl:value-of select="$generate-site-navigation"/>
|
generate-site-navigation: <xsl:value-of select="$generate-site-navigation"/>
|
||||||
|
@ -404,10 +404,10 @@
|
||||||
<xsl:attribute name="enctype">
|
<xsl:attribute name="enctype">
|
||||||
<xsl:choose>
|
<xsl:choose>
|
||||||
<xsl:when test="$form/ancestor::adl:entity//adl:property[@type='uploadable']">
|
<xsl:when test="$form/ancestor::adl:entity//adl:property[@type='uploadable']">
|
||||||
<xsl:value-of select="multipart/form-data"/>
|
<xsl:value-of select="'multipart/form-data'"/>
|
||||||
</xsl:when>
|
</xsl:when>
|
||||||
<xsl:when test="$form/ancestor::adl:entity//adl:property[@type='image']">
|
<xsl:when test="$form/ancestor::adl:entity//adl:property[@type='image']">
|
||||||
<xsl:value-of select="multipart/form-data"/>
|
<xsl:value-of select="'multipart/form-data'"/>
|
||||||
</xsl:when>
|
</xsl:when>
|
||||||
<xsl:otherwise>
|
<xsl:otherwise>
|
||||||
<xsl:value-of select="'application/x-www-form-urlencoded'"/>
|
<xsl:value-of select="'application/x-www-form-urlencoded'"/>
|
||||||
|
@ -582,31 +582,32 @@
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<xsl:attribute name="colspan">
|
||||||
|
<xsl:value-of select="count( field)"/>
|
||||||
|
</xsl:attribute>
|
||||||
|
|
||||||
<td>
|
<xsl:choose>
|
||||||
<xsl:attribute name="colspan">
|
<xsl:when test="@properties='listed'">
|
||||||
<xsl:value-of select="count( field)"/>
|
<xsl:comment>auxlist with listed fields: <xsl:value-of select="$farent/@name"/></xsl:comment>
|
||||||
</xsl:attribute>
|
<xsl:call-template name="internal-with-fields-list">
|
||||||
|
<xsl:with-param name="entity" select="//adl:entity[@name=$farent]"/>
|
||||||
<xsl:choose>
|
<xsl:with-param name="fields" select="adl:field"/>
|
||||||
<xsl:when test="@properties='listed'">
|
<xsl:with-param name="instance-list" select="concat( 'instance.', $listprop)"/>
|
||||||
<xsl:comment>auxlist with listed fields: <xsl:value-of select="$farent/@name"/></xsl:comment>
|
</xsl:call-template>
|
||||||
<xsl:call-template name="internal-with-fields-list">
|
</xsl:when>
|
||||||
<xsl:with-param name="entity" select="//adl:entity[@name=$farent]"/>
|
<xsl:otherwise>
|
||||||
<xsl:with-param name="fields" select="adl:field"/>
|
<xsl:comment>auxlist with computed fields: <xsl:value-of select="$farent/@name"/></xsl:comment>
|
||||||
<xsl:with-param name="instance-list" select="concat( 'instance.', $listprop)"/>
|
<xsl:call-template name="internal-with-properties-list">
|
||||||
</xsl:call-template>
|
<xsl:with-param name="entity" select="//adl:entity[@name=$farent]"/>
|
||||||
</xsl:when>
|
<xsl:with-param name="properties" select="//adl:entity[@name=$farent]//adl:property[(@distinct='user' or @distinct='all') and not( @type='link' or @type='list')]"/>
|
||||||
<xsl:otherwise>
|
<xsl:with-param name="instance-list" select="concat( 'instance.', $listprop)"/>
|
||||||
<xsl:comment>auxlist with computed fields: <xsl:value-of select="$farent/@name"/></xsl:comment>
|
</xsl:call-template>
|
||||||
<xsl:call-template name="internal-with-properties-list">
|
</xsl:otherwise>
|
||||||
<xsl:with-param name="entity" select="//adl:entity[@name=$farent]"/>
|
</xsl:choose>
|
||||||
<xsl:with-param name="properties" select="//adl:entity[@name=$farent]//adl:property[(@distinct='user' or @distinct='all') and not( @type='link' or @type='list')]"/>
|
</td>
|
||||||
<xsl:with-param name="instance-list" select="concat( 'instance.', $listprop)"/>
|
</tr>
|
||||||
</xsl:call-template>
|
|
||||||
</xsl:otherwise>
|
|
||||||
</xsl:choose>
|
|
||||||
</td>
|
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<xsl:template match="adl:verb">
|
<xsl:template match="adl:verb">
|
||||||
|
@ -913,7 +914,7 @@
|
||||||
Auto generated Velocity list for <xsl:value-of select="@name"/>,
|
Auto generated Velocity list for <xsl:value-of select="@name"/>,
|
||||||
generated from ADL.
|
generated from ADL.
|
||||||
|
|
||||||
Generated using adl2views.xslt <xsl:value-of select="substring( '$Revision: 1.30 $', 10)"/>
|
Generated using adl2views.xslt <xsl:value-of select="substring( '$Revision: 1.31 $', 10)"/>
|
||||||
Generation parameters were:
|
Generation parameters were:
|
||||||
locale: <xsl:value-of select="$locale"/>
|
locale: <xsl:value-of select="$locale"/>
|
||||||
generate-site-navigation: <xsl:value-of select="$generate-site-navigation"/>
|
generate-site-navigation: <xsl:value-of select="$generate-site-navigation"/>
|
||||||
|
@ -976,7 +977,7 @@
|
||||||
Auto generated Velocity list for <xsl:value-of select="ancestor::adl:entity/@name"/>,
|
Auto generated Velocity list for <xsl:value-of select="ancestor::adl:entity/@name"/>,
|
||||||
generated from ADL.
|
generated from ADL.
|
||||||
|
|
||||||
Generated using adl2listview.xsl <xsl:value-of select="substring( '$Revision: 1.30 $', 10)"/>
|
Generated using adl2listview.xsl <xsl:value-of select="substring( '$Revision: 1.31 $', 10)"/>
|
||||||
Generation parameters were:
|
Generation parameters were:
|
||||||
locale: <xsl:value-of select="$locale"/>
|
locale: <xsl:value-of select="$locale"/>
|
||||||
generate-site-navigation: <xsl:value-of select="$generate-site-navigation"/>
|
generate-site-navigation: <xsl:value-of select="$generate-site-navigation"/>
|
||||||
|
@ -1404,6 +1405,12 @@
|
||||||
<!-- assumed to be an instance of adl:form -->
|
<!-- assumed to be an instance of adl:form -->
|
||||||
</xsl:param>
|
</xsl:param>
|
||||||
<script type='text/javascript' language='JavaScript1.2'>
|
<script type='text/javascript' language='JavaScript1.2'>
|
||||||
|
#if ( ${site-root})
|
||||||
|
var siteRoot = '$siteRoot';
|
||||||
|
#else
|
||||||
|
var siteRoot = '<xsl:value-of select='$site-root'/>';
|
||||||
|
#end
|
||||||
|
|
||||||
function performInitialisation()
|
function performInitialisation()
|
||||||
{
|
{
|
||||||
<xsl:for-each select="$form/ancestor::adl:entity/adl:property[@type='link']">
|
<xsl:for-each select="$form/ancestor::adl:entity/adl:property[@type='link']">
|
||||||
|
@ -1419,8 +1426,8 @@
|
||||||
we /don't/ set up a submit handler. -->
|
we /don't/ set up a submit handler. -->
|
||||||
</xsl:choose>
|
</xsl:choose>
|
||||||
</xsl:for-each>
|
</xsl:for-each>
|
||||||
|
var validator = new Validation('<xsl:value-of select="$form/@name"/>', {immediate : true, useTitles : true});
|
||||||
}
|
}
|
||||||
var validator = new Validation('<xsl:value-of select="$form/name"/>', {immediate : true, useTitles : true});
|
|
||||||
|
|
||||||
<xsl:for-each select="//adl:typedef">
|
<xsl:for-each select="//adl:typedef">
|
||||||
<xsl:variable name="errormsg">
|
<xsl:variable name="errormsg">
|
||||||
|
@ -1684,6 +1691,10 @@
|
||||||
|
|
||||||
<xsl:template match="adl:content"/>
|
<xsl:template match="adl:content"/>
|
||||||
|
|
||||||
|
<xsl:template match="adl:help">
|
||||||
|
<xsl:apply-templates/>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
<!-- assuming an empty layout, install all the standard scripts
|
<!-- assuming an empty layout, install all the standard scripts
|
||||||
which an ADL page may need -->
|
which an ADL page may need -->
|
||||||
<xsl:template name="install-scripts">
|
<xsl:template name="install-scripts">
|
||||||
|
|
Loading…
Reference in a new issue