I need to be able to declare variables and after some markup later I need to reference them. In order to accomplish this, this is simplified version of my scala template:
@(map1:
java.util.LinkedHashMap[String,java.util.LinkedHashMap[String,Object]])
@import scala.collection.JavaConversions._
@import play.Logger
@for( (key,value) <- map1) {
<div>
@{
val rmap = Foo.someMethod(value)
val baz = rmap.getOrElse("baz", null)
<table border="0" cellpadding="0" cellspacing="0" >
<tbody>
<tr>
<td rowspan="3">
<div class="bar">
@baz
</div>
</td>
</tr>
</tbody>
</table>
}
</div>
}
Is above valid scala template and if not how can I declare baz and reference it later in the markup? I am using 1.2.2RC2 and scala 0.9.1