コントローラの関数からag:selectを設定しようとしていますが、可能ですか?
現在、これがあります:
def run(Long id) {
    def reportInstance = Report.get(id)
    def listPromptValues = populatePrompts(reportInstance)*.values()
    if (!reportInstance) {
        flash.message = message(code: 'default.not.found.message', args: [message(code: 'report.label', default: 'Report'), id])            
        return
    }
    [reportInstance: reportInstance, listPromptValues: listPromptValues]
}
def populatePrompts(Report rp){
    //for each prompt in the report, go out and get it's values
    rp.prompts.collectMany {
        reportService.listDatatypeValues(it.datatype)
    }
}
そして、問題のg:selectは
<li class="fieldcontain">
                <g:each var="prompt" in="${reportInstance.prompts}">
                    <span id="prompts-label" class="property-label">
                        <g:message code="report.prompts.label" default="${prompt.name}:" />
                    </span>
                    <g:if test="${prompt.datatype.type == 'DropDown'}">                         
                        <g:select id="prompt.name" from="${listPromptValues}" name="prompt.name" value="" noSelection="['':'']"/>
                        <br>                            
                    </g:if>
                </g:each>
            </li>
プロンプトが1つしかない場合は問題なく機能しますが、ループ内に複数のプロンプトがある場合は、gspビューから直接populatePrompt関数を呼び出して、reportIdを送信してからlistPromptValuesを取得できるようにする必要があります。onChange(remoteFunction ...)を正しく動作させることができないようで、広大なGoogleWebを検索する際に手ぶらで出てきます。
createLinkの仕組みのようなもの
${createLink(controller:'report', action:'runReport', id:"${reportInstance.id}")}
ただし、createLinkの代わりに、次のようなselectタグのfrom属性になります。
<g:select id="prompt.name" from="{(controller:'report',action:'populatePrompt', id:"${reportInstance.id}")}" name="prompt.name" value="" noSelection="['':'']"/>
何かアイデア、または進むべき方向はありますか?