Hello, I found the lookups plugin to be very usefull except that is seems to have been abandoned!
Installed the plugin in a brand new grails 1.36 project, theres no Lookup.valueFor(), no taglib ...
Doesn't look abandoned to me. Why do you say that? The plugin page mentions a 'lookupSelect' tag, so there is obviously a tag library provided.
Can you provide a working sample?
I'm also struggling with constraints as in the doc you mention Code:
import org.grails.plugins.lookups.Lookup
(...)
class AgendaReference {
static constraints = {
applications(blank:false, validator: {val, obj -gt;
return Lookup.valueForCode(quot;applicationsquot;, val) != null
})
(...)
but when on save I get:
Error 500: Executing action [save] of controller [agenda.AgendaReferenceController] caused exception: groovy.lang.MissingMethodException: No signature of method: static org.grails.plugins.lookups.Lookup.findByRealm() is applicable for argument types: (java.lang.String) values: [applications]
Servlet: grails
URI: /Agenda/grails/agendaReference/save.dispatch
Exception Message: No signature of method: static org.grails.plugins.lookups.Lookup.findByRealm() is applicable for argument types: (java.lang.String) values: [applications]
Caused by: No signature of method: static org.grails.plugins.lookups.Lookup.findByRealm() is applicable for argument types: (java.lang.String) values: [applications]
Class: AgendaReferenceController
At Line: [97]
Code Snippet:
Code:
groovy.lang.MissingMethodException: No signature of method: static org.grails.plugins.lookups.Lookup.findByRealm() is applicable for argument types: (java.lang.String) values: [applications]
at org.grails.plugins.lookups.Lookup.getRealm(Lookup.groovy:540)
at org.grails.plugins.lookups.Lookup$getRealm.call(Unknown Source)
at org.grails.plugins.lookups.Lookup.valueForCode(Lookup.groovy:117)
at org.grails.plugins.lookups.Lookup$valueForCode.call(Unknown Source)
at agenda.AgendaReference$__clinit__closure1_closure2.doCall(AgendaReference.groovy:42)
at agenda.AgendaReferenceController$_closure8_closure11.doCall(AgendaReferenceController.groovy:98)
at $Proxy14.doInTransaction(Unknown Source)
at agenda.AgendaReferenceController$_closure8.doCall(AgendaReferenceController.groovy:97)
at agenda.AgendaReferenceController$_closure8.doCall(AgendaReferenceController.groovy)
at java.lang.Thread.run(Thread.java:662)Ok sorry: I started a project from scratch and got the plugin working :-) |