What's wrong with this inline tag code?

15 views
Skip to first unread message

Harshdeep S Jawanda

unread,
May 29, 2014, 5:41:38 AM5/29/14
to rythm...@googlegroups.com
I decided to use inline tag feature to output a lot of repeated code and this is how I wrote it:

<td>@def addSelection(String key) { 

<form method="post" action="/path/id/@key">

<select name="toadd">

@for (Role role : Role.values()) {

<option value="@role.name()">@role.name()</option>

}

</select>&nbsp;<button type="submit">Add</button>

</form>

}

@addSelection(@acc.getKey())</td>


Here Role is an enum. When I run this code, I get an error message saying Syntax error on token "@", delete this token pointing to the line containing @addSelection(@acc.getKey()).

As far as I can make out this is similar to the example given at http://rythmengine.org/doc/template_guide.md#inline_tag , so what's the problem?

green

unread,
May 29, 2014, 6:05:40 AM5/29/14
to Harshdeep S Jawanda, Rythm Engine

The last line
@addSelection(@acc.getKey())</td>

should be
@addSelection(acc.getKey())</td>


--
You received this message because you are subscribed to the Google Groups "rythmengine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rythmengine...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Harshdeep S Jawanda

unread,
May 29, 2014, 6:10:15 AM5/29/14
to rythm...@googlegroups.com, Harshdeep S Jawanda
Yes, of course! Silly me!
Reply all
Reply to author
Forward
0 new messages