Beginner : need xtend help [message #697890] |
Mon, 18 July 2011 05:40  |
Eclipse User |
|
|
|
Hi,
I have a model which generates html tags like the below one
<form name="test" method=POST action="test.jps">
<input type=text name="name" length=30/>
</form>
The 'length' attribute is not a mandatory one. I have to add the length attribute only if it has been defined in dsl.
In xpand i have,
«FOREACH forms AS f»
<form name="«f.name»" "method="«f.methodType.name.toUpperCase()»" action="">
«FOREACH f.texts AS t»
<input type="text" name="«t.name»" maxlength="«t.maxlength»"/>
«ENDFOREACH»
</form>
«ENDFOREACH»
I have to add 'maxlength' attribute conditionally in my xpand template.
In Extensions.ext file , i have
boolean isMaxLengthExists(Model this) :
this.types.typeSelect(HTML).forms.texts.exists(e|e.maxlength) ;
//I'm getting error Boolean type expected! was Integer.
FYI, maxlength i s of type INT.
Thanks,
Arun
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04321 seconds