-
Jan 15th, 2012, 01:03 PM
#1
how to see a list variable, created in config.groovy, in GSP View page?
I wanted to use a configurable list of select options for my create.gsp as follows:
1) in Config.groovy:
catagory_list = ["Wedding", "Birthdays", "Celebrations", "Cupcakes"]
2) Then I created a tagLib to create this variable like this:
class GlobalVarsTagLib {
def catagoryOptions = {
out << grailsApplication.config.catagory_list
}
}
3) Then I tried to access this catagoryOptions list from my create.gsp as follows:
<%@ page import= "marlborocakes.GlobalVarsTagLib" %>
<g:select name="catagory" from="${GlobalVarsTagLib.catagoryOptions()}" ></g:select>
I am getting error as follows:
Caused by: Error processing GroovyPageView: Error executing tag <g:form>: Error evaluating expression [GlobalVarsTagLib.catagoryOptions()] on line [45]: groovy.lang.MissingMethodException: No signature of method: static marlborocakes.GlobalVarsTagLib.catagoryOptions() is applicable for argument types: () values: [] Possible solutions: getCatagoryOptions(), setCatagoryOptions(java.lang.Object) at /Users/sankumanis/Documents/workspace-sts-2.8.1.RELEASE/MarlboroCakes/grails-app/views/design/create.gsp:75
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules