I have a quick question for grails. I have a view page that iterates over an array of objects to display them. The HTML/Grails tag code looks like this:
<g:each in="${ICFList}" status="i" var="icf">
<tr>
<td>${icf.printName?.encodeAsHTML()}</td>
<td>${icf.activeNote?.encodeAsHTML()}</td>
</tr>
</g:each>
This code works and displays what I need. However, I don't want to store a printName variable inside my icf object anymore. the object also contains a one character code to identify it, and I have a method that looks up the printName value based on the code. Basically, my question is this:
Is there a way to do something like this
<td>${icf.getNameFromCode(${icf.code})}</td>
without having to store the name anywhere? The getNameFromCode method is defined in the controller object for this particular view, but I can't figure out how to access it from the gsp. Any help is greatly appreciated.