Search Results

Search found 645 results on 26 pages for 'grails'.

Page 11/26 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • Efficiently retrieve objects with one to many references in Grails using GORM

    - by bebeastie
    I'm trying to determine how to find/retrieve/load objects efficiently in terms of a.) minimizing calls to database and b.) keeping the code as elegant/simple as possible (i.e. not writing hql etc.). Assume you have two objects: public class Foo { Bar bar String badge } public class Bar { String name } Each Foo has a bar and a badge. Also assume that all badges are unique within a bar. So if a Foo has a badge "4565" there are no other Foos that have the same badge # AND the same bar. If I have a bar ID, how can I efficiently retrive the Foo w/o first selecting Bar? I know I can do this: Foo.findByBadgeAndBar("4565", Bar.findById("1")) But that seems to cause a select on the Bar table followed by a select on the Foo table. In other words, I need to produce the Grails/Hibernate/GORM equivalent of the following: select * from foo where badge="4565" and bar_id="1"

    Read the article

  • Overriding setter on domain class in grails 1.1.2

    - by Pavel P
    I have following two domain classes in Grails 1.1.2: class A implements Serializable { MyEnumType myField Date fieldChanged void setMyField(MyEnumType val) { if (myField != null && myField != val) { myField = val fieldChanged = new Date() } } } class B extends A { List children void setMyField(MyEnumType val) { if (myField != null && myField != val) { myField = val fieldChanged = new Date() children.each { child -> child.myField = val } } } When I set B instance's myField, I get the setter into the cycle... myField = val line calls setter again instead of assiging the new value. Any hint how to override the setter correctly? Thanks

    Read the article

  • Can't compile grails Tomcat plugin

    - by Jeff Beck
    I'm using Netbeans to build a Grails app, while I have used this fine before on this new computer I can not get even the basic project to compile and run. I am getting errors around compiling the Tomcat plugin. If I uninstall the plugin it and use Jetty instead it will compile but the project isn't set up for Jetty and is missing files. Below is the error I'm getting I'm thinking it is some issue with my classpath but I just don't know where to start any help would be much appreciated. java.lang.NoClassDefFoundError: org/apache/catalina/startup/Tomcat$ExistingStandardWrapper

    Read the article

  • Access Relationship Table in Grails

    - by WaZ
    Hi, I have the following domains classes: class Posts{ String Name String Country static hasMany = [tags:Tags] static constraints = { } } class Tags{ String Name static belongsTo = Posts static hasMany = [posts:Posts] static constraints = { } String toString() { "${TypeName}" } } Grails creates an another table in the database i.e. Posts_Tags. My requirement is: E.g. 1 post has 3 tags. So, in the Posts_Tags table there are 3 rows. How can I access the table Posts_Tags directly in my code so that I can manipulate the data or add some more fields to it.

    Read the article

  • Maven Grails web.xml

    - by dunn less
    Might be a stupid question, but in my current maven project i do not have a web.xml in my /web-app/WEB-INF folder. There is no web-xml in my project and never has been, im trying to add it but my application is non-responsive to anything written in the web.xml. What am i missing?, iv tried specifying the path to it through the config.groovy like: grails.project.web.xml="web-app/WEB-INF/web.xml" Am i missing something? Do i need to specify the web.xml in some other config file in order to make my project utilize it ?

    Read the article

  • Grails design for domain class initialization from static data

    - by Allison Eer
    I have some data, stateNames, to instantiate an instance of the object Country. Right now, I will only have one Country but stateNames for each country should be different. What is the best way to instantiate the instance of Country with my data? I am new to grails and would appreciate any "best practices" or common designs. One solution I can think of is to use BootStrap to save the unitedStates instance of Country to the database. What are the cons of this approach? Another solution would be to save the data in a file (in xml?) under web-app folder. If I did this approach, should the unitedStates instance of Country be instantiated by a controller?

    Read the article

  • grails mail connection refused

    - by mkoryak
    it seems i have tried the mail config in the way that its docs said, but still i get: Error 500: Executing action [x] of controller [x] caused exception: Mail server connection failed; nested exception is javax.mail.MessagingException: Could not connect to SMTP I am using google apps for my email so [email protected] is using gmail. i cannot get grails to send out a test message on my dev box (win 7). my config is: host = "smtp.gmail.com" port = 465 username = "[email protected]" password = "x" props = ["mail.smtp.auth":"true", "mail.smtp.debug":"true", "mail.smtp.starttls.enable":"true", "mail.smtp.socketFactory.port":"465", "mail.smtp.socketFactory.class":"javax.net.ssl.SSLSocketFactory", "mail.smtp.socketFactory.fallback":"false"]

    Read the article

  • Using OAuth along with spring security, grails

    - by GroovyUser
    I have grails app which runs on the spring security plugin. It works with no problem. I wish I could give the users the way to connect with Facebook and social networking site. So I decided to use Spring Security OAuth plugin. I have configured the plugin. Now I want user can access both via normal local account and also the OAuth authentication. More precisely I have a controller like this: @Secured(['IS_AUTHENTICATED_FULLY']) def test() { render "Home page!!!" } Now I want this controller to be accessed with OAuth authentication too. Is that possible to do so?

    Read the article

  • Can Grails exceptionHandler support the following Error Handling Flow

    - by Andrew
    In my rails app that I am porting to grails whenever an unexpected error occurs I intercept the error automatically and display a form to the user informing them that an error has occured and asking them for further information. Meanwhile, as the form is rendered I write the stack trace and other information about who was logged in to a database table. Then if the form is submitted I add that information to the error report. I cannot tell from the exceptionHandler documentation and BootStrap examples whether that will allow me to grab all the information including various session and request parameters and then stuff them into a database and then post a form. Any thoughts?

    Read the article

  • Creating a blocked user intercepter in Grails

    - by UltraVi01
    I am working on a social site where users can block other users. Throughout the site --dozens of places, user information is displayed. For example, user comments, reply forms, online user list.. etc etc.. The problem is that given the high number of places user info is displayed, it's becoming very difficult to check each time if that user is blocked. For example: <g:each var="comment" in="${comments}"> <g:if test="!${loggedInUser.blockedUsers.find { it == comment.user}"> show comment </g:if> </g:each> Does Grails provide any functionality that would facilitate creating some kind of filter or intercepter where I could simply exclude blocked users when iterating lists, etc? If not, what would you suggest I do?

    Read the article

  • grailsApplication not getting injected in a service , Grails 2.1.0

    - by vijay tyagi
    I have service in which i am accessing few configuration properties from grailsApplication I am injecting it like this class MyWebService{ def grailsApplication WebService webService = new WebService() def getProxy(url, flag){ return webService.getClient(url) } def getResponse(){ def proxy = getProxy(grailsApplication.config.grails.wsdlURL, true) def response = proxy.getItem(ItemType) return response } } When i call getProxy() method, i see this in tomcat logs No signature of method: org.example.MyWebService.getProxy() is applicable for argument types: (groovy.util.ConfigObject, java.lang.Boolean) values: [[:], true] Possible solutions: getProxy(), getProxy(java.lang.String, boolean), setProxy(java.lang.Object) which means grailsApplication is not getting injected into the service, is there any alternate way to access configuration object ? according to burtbeckwith's post configurationholder has been deprecated, can't think of anything else. Interestingly the very same service works fine in my local IDE(GGTS 3.1.0), that means locally grailsApplication is getting injected, but when i create a war to deploy to a standalone tomcat, it stops getting injected.

    Read the article

  • Grails background call vie camle or background-thread

    - by user304217
    I need to improve the response time for a Grails application, so I need to use concurrent processing to separate work that can be done after the users web page is refreshed It seems like the Camel and background-thread plugins can do this for me. I tried the Camel way, but get 'Session does not exists' errors, which looks like hibernate can not operate in an Camel acynchonouse call. In the background-thread description they mention that they solved this problem. Can any one tell me which which will be the better choice and which ones plays nicely with Hibernate? All the best Ulrich

    Read the article

  • Grails searchable plugin with hasMany

    - by user2624442
    I am using grails searchable plugin to search my domain classes. However, I cannot yet search by my hasMany (skills and interests) fields even though they are of the simple type String. This is my domain class: class EmpactUser { static searchable = [except: ['dateCreated','password','enabled','accountExpired','accountLocked','passwordExpired']] String username String password boolean enabled = true boolean accountExpired boolean accountLocked boolean passwordExpired String email String firstName String lastName String address String phoneNumber String description byte[] avatar byte[] resume Date dateCreated static hasMany = [ skills : String, interests : String, // each user has the ability to list many skills and interests so that they can be matched with a project. ] static constraints = { username blank: false, unique: true password blank: false email email: true, blank: false firstName blank: false lastName blank: false description nullable: true address nullable: true avatar nullable: true, maxSize: 1024 * 1024 * 10 resume nullable: true, maxSize: 1024 * 1024 * 10 phoneNumber nullable: true, matches: "/[(][+]d{3}[)]d+/", maxSize: 30 } } This is the code I am using to search: def empactUserList = EmpactUser.search( searchQuery, [reload: false, result: "every", defaultOperator: "or"]) Am I missing something? Thanks, Alan.

    Read the article

  • Ajax call from a form rendered as Ajax response (jQuery + Grails: chaining ajax requests)

    - by bsreekanth
    Hello, I was expecting the below scenario common, but couldn't find much help online. I have a form loaded through Ajax (say, create entity form). It is loaded through a button click (load) event $("#bt-create").click(function(){ $ ('#pid').load('/controller/vehicleModel/create3'); return false; }); the response (a form) is written in to the pid element. The name and id of the form is ajax-form, and the submit event is attached to an ajax post request $(function() { $("#ajax-form").submit(function(){ // do something... var url = "/app/controller/save" $.post(url, $(this).serialize(), function(data) { alert( data ) ; /// alert data from server }); I could make the above ajax operations individually. That is the ajax post operation succeeds if it calls from a static html file. But if I chain the requests (after completing the first), so that it calls from the output form generated by the first request, nothing happens. I could see the post method is called through firebug. Is there a better way to handle above flow? One more interesting thing I noticed. As you could see, I use grails as my platform. If I keep the javascripts in the main.gsp (master layout), the submit event would not register as the breakpoint is not hit in firebug. But, if I define the javascript in the template file (which renders the form above), the breakpoint is hit, but as I explained, the action is not called at the controller. I changes the javascript to the head section but same result. any help greatly appreciated. thanks, Babu.

    Read the article

  • Grails - Simple hasMany Problem - How does 'save' work?

    - by gav
    My problem is this: I want to create a grails domain instance, defining the 'Many' instances of another domain that it has. I have the actual source in a Google Code Project but the following should illustrate the problem. class Person { String name static hasMany[skills:Skill] static constraints = { id (visible:false) skills (nullable:false, blank:false) } } class Skill { String name String description static constraints = { id (visible:false) name (nullable:false, blank:false) description (nullable:false, blank:false) } } If you use this model and def scaffold for the two Controllers then you end up with a form like this that doesn't work; My own attempt to get this to work enumerates the Skills as checkboxes and looks like this; But when I save the Volunteer the skills are null! This is the code for my save method; def save = { log.info "Saving: " + params.toString() def skills = params.skills log.info "Skills: " + skills def volunteerInstance = new Volunteer(params) log.info volunteerInstance if (volunteerInstance.save(flush: true)) { flash.message = "${message(code: 'default.created.message', args: [message(code: 'volunteer.label', default: 'Volunteer'), volunteerInstance.id])}" redirect(action: "show", id: volunteerInstance.id) log.info volunteerInstance } else { render(view: "create", model: [volunteerInstance: volunteerInstance]) } } This is my log output (I have custom toString() methods); 2010-05-10 21:06:41,494 [http-8080-3] INFO bumbumtrain.VolunteerController - Saving: ["skills":["1", "2"], "name":"Ian", "_skills":["", ""], "create":"Create", "action":"save", "controller":"volunteer"] 2010-05-10 21:06:41,495 [http-8080-3] INFO bumbumtrain.VolunteerController - Skills: [1, 2] 2010-05-10 21:06:41,508 [http-8080-3] INFO bumbumtrain.VolunteerController - Volunteer[ id: null | Name: Ian | Skills [Skill[ id: 1 | Name: Carpenter ] , Skill[ id: 2 | Name: Sound Engineer ] ]] Note that in the final log line the right Skills have been picked up and are part of the object instance. When the volunteer is saved the 'Skills' are ignored and not commited to the database despite the in memory version created clearly does have the items. Is it not possible to pass the Skills at construction time? There must be a way round this? I need a single form to allow a person to register but I want to normalise the data so that I can add more skills at a later time. If you think this should 'just work' then a link to a working example would be great. Hope this makes sense, thanks in advance! Gav

    Read the article

  • Problem with grails web app running in production: "No such property: save for class: JsecRole"

    - by Sarah Boyd
    I've got a grails 1.1 web app running great in development but when I try and run it in production with an sqlserver database it crashes in a weird way. The relevant part of my datasource.groovy is as follows: environments { development { dataSource { dbCreate = "create-drop" // one of 'create', 'create-drop','update' url = "jdbc:hsqldb:mem:devDB" } } test { dataSource { dbCreate = "update" url = "jdbc:hsqldb:mem:testDb" } } production { dataSource { dbCreate = "update" driverClassName = "com.microsoft.sqlserver.jdbc.SQLServerDriver" endUsername = "sa" password = "pw4db" url = "jdbc:sqlserver://localhost:1433;databaseName=ReleasePlanner;selectMethod=cursor" The error message I receive is: Message: No such property: save for class: JsecRole Caused by: groovy.lang.MissingPropertyException: No such property: save for class: JsecRole Class: ProjectController At Line: [28] Code Snippet: 27: println "###about to create project roles" 28: userManagerService.createProjectRoles(project) 29: userManagerService.addUserToProject(session.user.id.toString(), project, 'owner') } } } The stacktrace is as follows: org.codehaus.groovy.runtime.InvokerInvocationException: groovy.lang.MissingPropertyException: No such property: save for class: JsecRole at org.jsecurity.web.servlet.JSecurityFilter.doFilterInternal(JSecurityFilter.java:382) at org.jsecurity.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:180) Caused by: groovy.lang.MissingPropertyException: No such property: save for class: JsecRole at UserManagerService.createProjectRoles(UserManagerService.groovy:9) at UserManagerService$$FastClassByCGLIB$$6fa73713.invoke(<generated>) at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149) at UserManagerService$$EnhancerByCGLIB$$fcf60984.createProjectRoles(<generated>) at UserManagerService$createProjectRoles.call(Unknown Source) at ProjectController$_closure4.doCall(ProjectController.groovy:28) at ProjectController$_closure4.doCall(ProjectController.groovy) ... 2 more Any help is appreciated. Thanks Sarah

    Read the article

  • Grails - Recursive computing call "StackOverflowError" and don't update on show

    - by Kedare
    Hello, I have a little problem, I have made a Category domain on Grails, but I want to "cache" the string representation on the database by generating it when the representation field is empty or NULL (to avoid recursive queries at each toString), here is the code : package devkedare class Category { String title; String description; String representation; Date dateCreated; Date lastUpdate; Category parent; static constraints = { title(blank:false, nullable:false, size:2..100); description(blank:true, nullable:false); dateCreated(nullable:true); lastUpdate(nullable:true); autoTimestamp: true; } static hasMany = [childs:Category] @Override String toString() { if((!this.representation) || (this.representation == "")) { this.computeRepresentation(true) } return this.representation; } String computeRepresentation(boolean updateChilds) { if(updateChilds) { for(child in this.childs) { child.representation = child.computeRepresentation(true); } } if(this.parent) { this.representation = "${this.parent.computeRepresentation(false)}/${this.title}"; } else { this.representation = this.title } return this.representation; } void beforeUpdate() { this.computeRepresentation(true); } } There is 2 problems : It don't update the representation when the representation if NULL or empty and toString id called, it only update it on save, how to fix that ? On some category, updating it throw a StackOverflowError, here is an example of my actual category table as CSV : Uploaded the csv file here, pasting csv looks buggy: http://kedare.free.fr/Dist/01.csv Updating the representation works everywhere except on "IT" that throw a StackOverlowError (this is the only category that has many childs). Any idea of how can I fix those 2 problems ? Thank you !

    Read the article

  • Associations and the Grails webflow

    - by callie16
    Hi, it's my first time using webflows in Grails and I can't seem to solve this. I have 3 domain classes with associations that look something like this: class A { ... static hasMany = [ b : B ] ... } class B { ... static belongsTo = [ a : A ] static hasMany = [ c : C ] ... } class C { ... static belongsTo = [ b : B ] ... } Now, the GSP communicates with the controller via Javascript (due to my use of Dojo). When I try to remoteFunction a normal action, I can do something like this: def action1 = { def anId = params.id def currA = A.get(anId) def sample = currA.b?.c // I can get all the way to 'c' without any problems ... } However, I have a webflow and the contents of that action is in the webflow... It looks something like this: def someFlow = { ... someState { on("next") { def anId = params.id // this does NOT return a null value def currA = A.get(anId) // this does NOT return a null value def sample = currA.b // error already occurs here and I need to get 'c'! }.("somePage") ... } ... } In this case, it tells me that b doesn't exist... so I can't even get to 'c'. Any suggestions on what to do??? Thanks... getting real desperate...

    Read the article

  • faster way to change xml to array(grails to flex)

    - by Anthony Umpad
    I have a large xml passed from grails to flex. When flex receives the xml, it converts the xml into an associative array object. Given the large xml file, it takes too long to complete the loop, is there any way in flex to make conversion faster? Below is my sample code. <xml> <car> <model>Vios</model> <type>Sedan</type> <color>Blue</color> </car> <car> <model>Camry</model> <type>Luxury</type> <color>Black</color> </car> </xml> *converted to the flex associative array below.* [Vios].type = Sedan .color = Blue [Camry].type = Luxury .color = Black *Below is a code I used in flex to convert the xml to the associative array object* var tempXML=xml.children() var tempArray:Array= new Array() for(var i:int=0;i<tempXML.length();i++) { tempArray[tempXML[i].@model]= new Object(); tempArray[tempXML[i].@model].color = tempXML[i][email protected](); tempArray[tempXML[i].@model].type = tempXML[i][email protected](); }

    Read the article

  • How to get at JSON in grails 2.0

    - by Mikey
    I am sending myself JSON like so with jQuery: $.ajax ({ type: "POST", url: 'http://localhost:8080/myproject/myController/myAction', dataType: 'json', async: false, //json object to sent to the authentication url data: {"stuff":"yes", "listThing":[1,2,3], "listObjects":[{"one":"thing"},{"two":"thing2"}]}, success: function () { alert("Thanks!"); } }) I send this to a controller and do println params And I know I'm already in trouble... [stuff:yes, listObjects[1][two]:thing2, listObjects[0][one]:thing, listThing[]:[1, 2, 3], action:myAction, controller:myController] I cannot figure out how to get at most of these values... I can get "yes" with params.stuff, but I cant do params.listThing.each{} or params.listObjects.each{} What am I doing wrong? UPDATE: I make the controller do this to try the two suggestions so far: println params println params.stuff println params.list('listObjects') println params.listThing def thisWontWork = JSON.parse(params.listThing) render("omg l2json") look how weird the parameters look at the end of the null pointer exception when I try the answers: [stuff:yes, listObjects[1][two]:thing2, listObjects[0][one]:thing, listThing[]:[1, 2, 3], action:l2json, controller:rateAPI] yes [] null | Error 2012-03-25 22:16:13,950 ["http-bio-8080"-exec-7] ERROR errors.GrailsExceptionResolver - NullPointerException occurred when processing request: [POST] /myproject/myController/myAction - parameters: stuff: yes listObjects[1][two]: thing2 listObjects[0][one]: thing listThing[]: 1 listThing[]: 2 listThing[]: 3 UPDATE 2 I am learning things, but this can't be right: println params['listThing[]'] println params['listObjects[0][one]'] prints [1, 2, 3] thing It seems like this is some part of grails new JSON marshaling. This is somewhat inconvenient for my purposes of hacking around with the values. How would I get all these individual params back into a big groovy object of nested maps and lists? Maybe I am not doing what I want with jQuery?

    Read the article

  • Black Magic in Grails Data Binding!?

    - by Tiago Alves
    As described in http://n4.nabble.com/Grails-Data-Binding-for-One-To-Many-Relationships-with-REST-tp1754571p1754571.html i'm trying to automatically bind my REST data. I understand now that for one-to-many associations the map that is required for the data binding must have a list of ids of the many side such as: [propName: propValue, manyAssoc: [1, 2]] However, I'm getting this exception Executing action [save] of controller [com.example.DomainName] caused exception: org.springframework.orm.hibernate3.HibernateSystemException: IllegalArgumentException occurred calling getter of com.example.DomainName.id; nested exception is org.hibernate.PropertyAccessException: IllegalArgumentException occurred calling getter of com.example.DomainName.id However, even weirder is the update action that is generated for the controller. There we have the databinding like this: domainObjectInstance.properties = params['domainObject'] But, and this is the really weird thing, params['domainObject'] is null! It is null because all the domainObject fields are passed directly in the params map itself. If I change the above line to domainObjectInstance.properties = null the domainObject is still updated! Why is this happening and more important, how can I bind my incoming XML automatically if it comes in this format (the problem is the one-to-many associations): <product> <name>Table</name> <brand id="1" /> <categories> <category id="1" /> <category id="2" /> </categories> </product>

    Read the article

  • Grails one-to-many mapping with joinTable

    - by intargc
    I have two domain-classes. One is a "Partner" the other is a "Customer". A customer can be a part of a Partner and a Partner can have 1 or more Customers: class Customer { Integer id String name static hasOne = [partner:Partner] static mapping = { partner joinTable:[name:'PartnerMap',column:'partner_id',key:'customer_id'] } } class Partner { Integer id static hasMany = [customers:Customer] static mapping = { customers joinTable:[name:'PartnerMap',column:'customer_id',key:'partner_id'] } } However, whenever I try to see if a customer is a part of a partner, like this: def customers = Customer.list() customers.each { if (it.partner) { println "Partner!" } } I get the following error: org.springframework.dao.InvalidDataAccessResourceUsageException: could not execute query; SQL [select this_.customer_id as customer1_162_0_, this_.company as company162_0_, this_.display_name as display3_162_0_, this_.parent_customer_id as parent4_162_0_, this_.partner_id as partner5_162_0_, this_.server_id as server6_162_0_, this_.status as status162_0_, this_.vertical_market as vertical8_162_0_ from Customer this_]; nested exception is org.hibernate.exception.SQLGrammarException: could not execute query It looks as if Grails is thinking partner_id is a part of the Customer query, and it's not... It is in the PartnerMap table, which is supposed to find the customer_id, then get the Partner from the corresponding partner_id. Anyone have any clue what I'm doing wrong? Edit: I forgot to mention I'm doing this with legacy database tables. So I have a Partner, Customer and PartnerMap table. PartnerMap has simply a customer_id and partner_id field.

    Read the article

  • Grails - Simple hasMany Problem - Using CheckBoxes rather than HTML Select in create.gsp

    - by gav
    My problem is this: I want to create a grails domain instance, defining the 'Many' instances of another domain that it has. I have the actual source in a Google Code Project but the following should illustrate the problem. class Person { String name static hasMany[skills:Skill] static constraints = { id (visible:false) skills (nullable:false, blank:false) } } class Skill { String name String description static constraints = { id (visible:false) name (nullable:false, blank:false) description (nullable:false, blank:false) } } If you use this model and def scaffold for the two Controllers then you end up with a form like this that doesn't work; My own attempt to get this to work enumerates the Skills as checkboxes and looks like this; But when I save the Volunteer the skills are null! This is the code for my save method; def save = { log.info "Saving: " + params.toString() def skills = params.skills log.info "Skills: " + skills def volunteerInstance = new Volunteer(params) log.info volunteerInstance if (volunteerInstance.save(flush: true)) { flash.message = "${message(code: 'default.created.message', args: [message(code: 'volunteer.label', default: 'Volunteer'), volunteerInstance.id])}" redirect(action: "show", id: volunteerInstance.id) log.info volunteerInstance } else { render(view: "create", model: [volunteerInstance: volunteerInstance]) } } This is my log output (I have custom toString() methods); 2010-05-10 21:06:41,494 [http-8080-3] INFO bumbumtrain.VolunteerController - Saving: ["skills":["1", "2"], "name":"Ian", "_skills":["", ""], "create":"Create", "action":"save", "controller":"volunteer"] 2010-05-10 21:06:41,495 [http-8080-3] INFO bumbumtrain.VolunteerController - Skills: [1, 2] 2010-05-10 21:06:41,508 [http-8080-3] INFO bumbumtrain.VolunteerController - Volunteer[ id: null | Name: Ian | Skills [Skill[ id: 1 | Name: Carpenter ] , Skill[ id: 2 | Name: Sound Engineer ] ]] Note that in the final log line the right Skills have been picked up and are part of the object instance. When the volunteer is saved the 'Skills' are ignored and not commited to the database despite the in memory version created clearly does have the items. Is it not possible to pass the Skills at construction time? There must be a way round this? I need a single form to allow a person to register but I want to normalise the data so that I can add more skills at a later time. If you think this should 'just work' then a link to a working example would be great. If I use the HTML Select then it works fine! Such as the following to make the Create page; <tr class="prop"> <td valign="top" class="name"> <label for="skills"><g:message code="volunteer.skills.label" default="Skills" /></label> </td> <td valign="top" class="value ${hasErrors(bean: volunteerInstance, field: 'skills', 'errors')}"> <g:select name="skills" from="${uk.co.bumbumtrain.Skill.list()}" multiple="yes" optionKey="id" size="5" value="${volunteerInstance?.skills}" /> </td> </tr> But I need it to work with checkboxes like this; <tr class="prop"> <td valign="top" class="name"> <label for="skills"><g:message code="volunteer.skills.label" default="Skills" /></label> </td> <td valign="top" class="value ${hasErrors(bean: volunteerInstance, field: 'skills', 'errors')}"> <g:each in="${skillInstanceList}" status="i" var="skillInstance"> <label for="${skillInstance?.name}"><g:message code="${skillInstance?.name}.label" default="${skillInstance?.name}" /></label> <g:checkBox name="skills" value="${skillInstance?.id.toString()}"/> </g:each> </td> </tr> The log output is exactly the same! With both style of form the Volunteer instance is created with the Skills correctly referenced in the 'Skills' variable. When saving, the latter fails with a null reference exception as shown at the top of this question. Hope this makes sense, thanks in advance! Gav

    Read the article

  • Grails YUI- Datatable complete refresh

    - by geeronimo
    Hi, I have inserted a paginator for my YUI-Datatable. Now I want to refresh my whole page, when the user has changed the view in my Datatable. YUI makes just a refresh (remoteCall) for itself, but I need a refresh for the whole page, because I want to update my Flashanimation too. For any sugest I would be very grateful, Geeron imo Here´s the code for my datatable: paginatorConfig="[ template:'{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {CurrentPageReport}', pageReportTemplate : '{startRecord} - {endRecord} von {totalRecords}', containers:'dt-paginator', firstPageLinkLabel: '&lt;&lt;', lastPageLinkLabel: '&gt;&gt;', previousPageLinkLabel: '&lt;', nextPageLinkLabel: '&gt;' ]" />

    Read the article

  • grails 1.3.1 Error executing script GenerateViews:

    - by mswallace
    Here is the lay of the land. I have an app that I have created. I uninstalled hibernate, installed app-engine plugin and am using jdo. I am able to create a domain-class but the when I run generate-all I run into the following error. Oh and I did try just generating the controller for the domain class and that seemed to work fine but then after that I try just generate-views on the same domain class and I also get the following error. Error executing script GenerateViews: java.lang.reflect.InvocationTargetException java.lang.reflect.InvocationTargetException at gant.Gant$_dispatch_closure5.doCall(Gant.groovy:391) at gant.Gant$_dispatch_closure7.doCall(Gant.groovy:415) at gant.Gant$_dispatch_closure7.doCall(Gant.groovy) at gant.Gant.withBuildListeners(Gant.groovy:427) at gant.Gant.this$2$withBuildListeners(Gant.groovy) at gant.Gant$this$2$withBuildListeners.callCurrent(Unknown Source) at gant.Gant.dispatch(Gant.groovy:415) at gant.Gant.this$2$dispatch(Gant.groovy) at gant.Gant.invokeMethod(Gant.groovy) at gant.Gant.executeTargets(Gant.groovy:590) at gant.Gant.executeTargets(Gant.groovy:589) Caused by: java.lang.reflect.InvocationTargetException at SimpleTemplateScript1.run(SimpleTemplateScript1.groovy:43) at _GrailsGenerate_groovy.generateForDomainClass(_GrailsGenerate_groovy:85) at _GrailsGenerate_groovy$_run_closure1.doCall(_GrailsGenerate_groovy:50) at GenerateViews$_run_closure1.doCall(GenerateViews.groovy:33) at gant.Gant$_dispatch_closure5.doCall(Gant.groovy:381) ... 10 more Caused by: java.lang.NoClassDefFoundError: org/hibernate/mapping/Value ... 15 more Caused by: java.lang.ClassNotFoundException: org.hibernate.mapping.Value at org.codehaus.groovy.tools.RootLoader.findClass(RootLoader.java:156) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at org.codehaus.groovy.tools.RootLoader.loadClass(RootLoader.java:128) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) ... 15 more --- Nested Exception --- java.lang.reflect.InvocationTargetException at SimpleTemplateScript1.run(SimpleTemplateScript1.groovy:43) at _GrailsGenerate_groovy.generateForDomainClass(_GrailsGenerate_groovy:85) at _GrailsGenerate_groovy$_run_closure1.doCall(_GrailsGenerate_groovy:50) at GenerateViews$_run_closure1.doCall(GenerateViews.groovy:33) at gant.Gant$_dispatch_closure5.doCall(Gant.groovy:381) at gant.Gant$_dispatch_closure7.doCall(Gant.groovy:415) at gant.Gant$_dispatch_closure7.doCall(Gant.groovy) at gant.Gant.withBuildListeners(Gant.groovy:427) at gant.Gant.this$2$withBuildListeners(Gant.groovy) at gant.Gant$this$2$withBuildListeners.callCurrent(Unknown Source) at gant.Gant.dispatch(Gant.groovy:415) at gant.Gant.this$2$dispatch(Gant.groovy) at gant.Gant.invokeMethod(Gant.groovy) at gant.Gant.executeTargets(Gant.groovy:590) at gant.Gant.executeTargets(Gant.groovy:589) Caused by: java.lang.NoClassDefFoundError: org/hibernate/mapping/Value ... 15 more Caused by: java.lang.ClassNotFoundException: org.hibernate.mapping.Value at org.codehaus.groovy.tools.RootLoader.findClass(RootLoader.java:156) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at org.codehaus.groovy.tools.RootLoader.loadClass(RootLoader.java:128) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) ... 15 more

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >