grails - Creating a new entry with preset values -


Resolved I really do not know what I did, but it worked. One of those moments ...

My domain object is "Actiune" I want to add a new entry with 4 preset fields which is the ID given to the "createNewEtapa" method. So I check that entry (with ID) and get its values, set it in the form and save the hit but it does not work. Savings will not work.

What am I doing wrong? I am going around this for hours please help with the stack overflow again :)

If you have not been feeling like checking all the codes, please tell me how did this I have or have an example link :)

Thx!

This is the reallight part of my code

This is my GSP form:

  & Lt; G: form action = "save" antipype = "multipart / form-data" & gt; & Lt; Fieldet class = "form" & gt; & Lt; G: applyLayout name = "form" & gt; & Lt; Tmpl: / template / form / & gt; & Lt; / H: applyLayout & gt; & Lt; / Fieldset & gt; & Lt; Fieldet class = "button" & gt; & Lt; G: submitButton name = "create" class = "save" value = "$ {message (code: 'default.button.adauga.label', default: 'Adauga')}" /> & Lt; G: Submit Action Name = "create" class = "save" action = "savenew" value = "adauga2" /> & Lt; / Fieldset & gt; & Lt; / G: form & gt;   

This is my admin:

  def (long id) {def actiuneInstance = Actiune.findById (id) def c = Actiune.createCriteria () def instanceList = c {eq ( "idActiune", actiuneInstance.idActiune) order ( "termenPornire", "ASC")} params.idActiune = actiuneInstance.idActiune params.tema = actiuneInstance.tema params.firma = actiuneInstance.firma params.user = User.findById (springSecurityService.currentUser.id) [example: new Actiune (parameters)]} def save () {def actiuneInstance = new Actiune (parameters) actiuneInstance.user = User.findById (springSecurityService .currentUser.id) actinuneInstance.termenPornire = new date () def actiuneBD = Actiune.findByIdActiune (params.idActiune) actiuneInstance.idActiune = actiuneBD.id Actiune actiuneInstance.tema = actiuneBD.tema actiuneInstance.firma = actiuneBD.firma "+ Paramej print" parameter Print Save "\\" Print "..." + actiuneInstance.properties if (! ActiuneInstance.save (flush: true ); Render (see: "create", model: [FirInstance: actiuneInstance]) return} flash.message = message (code: 'default.created.message', arg: [Messaging (code: 'actiune.label' Default: 'Actiune'), actiuneInstance.idActiune]) redirect (action: "full show", id: actiuneInstance.id)}   

This output from print (save) methods () Method * ... * parameter [termenLimita_month in: 11, termenPornire_month: 11, termenPornire_day: 1, documentPath:, Subject: Promotie A, termenLimita_day: 1, _action_savenew: Adauga2, ID:, observatii: uuu, termenLimita: Date. Struct, termenPornire_year: 2012, etapa.id:1, etapa: [id: 1], contact.id:1, contact: [id: 1], termenPornire: date.struct, firma: Google, idActiune: zt8h, terminimity_year : 2012, Action: Save, Controller: Acton] < ....

Save them ... [User: Flavian, Terminator: Thursday 01 22:57:45 EET 2012, contact: null, documentPath: null, temaId: 1, etapaId: null, firmaId: 3, firma: google, contactId: null, termenLimita: null, idActiune: zt8h, observat ii: null, userId: null, etapa: Null, tema: promo a]

call ActiuneInstance.validate () and Then any of your objects See to see the result of accreditation errors.

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -