flash.messageを使用してさまざまなメッセージを表示する必要があります。そのうちのいくつかは異なる色である必要があります。したがって、flash.messageを区別し、GSPで異なる色で表示する方法
質問する
3081 次
1 に答える
4
エラーを表示し、メッセージを別のスタイルで表示するためのページコードの表示
<g:if test="${flash.message}">
<div class="message" role="status" style="font-size: medium;color: green;">${flash.message}</div>
</g:if>
<g:if test="${flash.warning}">
<div class="message_error" style="font-size: medium;color: red;">${flash.warning}</div>
</g:if>
スキューの場合にそれぞれのラベルを呼び出すコントローラーコード:
flash.message = message(code: 'Applied Successfully', args: [message(code: 'hrIrRegistration.label', default: 'HrIrRegistration'), hrIrAplcJobAppldLkInstance.id])
redirect(controller: "hrIrRegistration", action: "showVcnyForApplcnt", id: params.hrIrVcncyIdHrIrVcncy.id)
エラーの場合:
flash.warning = message(code: 'You have already Applied in this vacancy', args: [message(code: 'hrIrRegistration.label', default: 'HrIrRegistration'), hrIrAplcJobAppldLkInstance.id])
redirect(controller: "hrIrRegistration", action: "showVcnyForApplcnt", id: params.hrIrVcncyIdHrIrVcncy.id)
于 2014-02-19T05:22:50.110 に答える