0
<#macro inputValidatedTextCell name size=30  vreq="N" vtype="" class="" maxlength="" default="" index=-1 password=false readonly=false onChange="" id="" ignoreParameters=false errorField="" tabIndex="" colspan="" tooltip="">
   <#if ( vreq.equals("Y") && (!vtype.equals("")))><#assign vclass = "validation[required,custom[${vtype}}]]"><#elseif vreq.equals("Y")><#assign vclass = "validate[required]"><#else><#assign vclass = "validation[custom[${vtype}]]"></#if>
  <td<#if colspan?has_content>colspan="${colspan}"</#if>>
  <@inputText name=name id=name class=vclass
  size=size maxlength=maxlength default=default index=index password=password readonly=readonly onChange=onChange ignoreParameters=ignoreParameters errorField=errorField tabIndex=tabIndex tooltip=tooltip/>
  </td>
</#macro>

我收到此错误: Expected hash. vreq evaluated instead to freemarker.template.SimpleScalar on line 300, column 11 in opentapsFormMacros. The problematic instruction: ---------- ==> if-else [on line 300, column 4 in opentapsFormMacros] in user-directive inputValidatedTextCell [on line 17, column 5 in component://multitenancy-support/webapp/multitenancy-support/controlpanel/replenishmentConfigForm.ftl] in user-directive frameSection [on line 2, column 1 in ....etc....

4

1 回答 1

0

这不是语法错误,而是运行时错误。它基本上说这vreq只是一个字符串,所以它没有子变量(之后的东西.)。你应该只写:

<#if vreq == "Y" && vtype != "">
于 2012-11-12T09:18:09.133 回答