Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8776195
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T18:59:37+00:00 2026-06-13T18:59:37+00:00

Solved. I really don’t know what I did, but it worked. One of those

  • 0

Solved. I really don’t 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 from another entry that has the given id to “createNewEtapa” method. So I query that entry (with the id) and get it’s values, preset them in the form and the hit save but it does not work. The save will not work.

What am I doing wrong ? I’ve been going around this for hours. Please help again stackOverflow 🙂

If you don’t feel like checking all the code, please just let me know how is this done or link me a example 🙂

Thx!

These are the relevalt parts of my code

This is my GSP form:

<g:form action="save" enctype="multipart/form-data">

                <fieldset class="form">

                    <g:applyLayout name="form">
                        <tmpl:/templates/form />
                    </g:applyLayout>
                </fieldset>

                <fieldset class="buttons">

                    <g:submitButton name="create" class="save"
                        value="${message(code: 'default.button.adauga.label', default: 'Adauga')}" />
                    <g:actionSubmit name="create" class="save" action="savenew" value="Adauga2" />

                </fieldset>
            </g:form>

This is my controller:

def create(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)

[instance: new Actiune(params)]
}

def save() {
def actiuneInstance = new Actiune(params)
actiuneInstance.user = User.findById(springSecurityService.currentUser.id)
actiuneInstance.termenPornire = new Date()

def actiuneBD = Actiune.findByIdActiune(params.idActiune)
actiuneInstance.idActiune = actiuneBD.idActiune
actiuneInstance.tema = actiuneBD.tema
actiuneInstance.firma = actiuneBD.firma

print "in params  " + params
print "\\"
print "in save...       " + actiuneInstance.properties

   if (!actiuneInstance.save(flush: true)) {
        render(view: "create", model: [firInstance: actiuneInstance])
        return
    }
flash.message = message(code: 'default.created.message', args: [message(code: 'actiune.label', default: 'Actiune'), actiuneInstance.idActiune])
redirect(action: "completeShow", id: actiuneInstance.id)
}

This is the output from the print statements in the save() method
*…*
in params [termenLimita_month:11, termenPornire_month:11, termenPornire_day:1, documentPath:, tema: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, termenLimita_year:2012, action:save, controller:actiune]
\
….

in save… [user:Flavian, termenPornire:Thu Nov 01 22:57:45 EET 2012, contact:null, documentPath:null, temaId:1, etapaId:null, firmaId:3, firma:Google, contactId:null, termenLimita:null, idActiune:zt8h, observatii:null, userId:null, etapa:null, tema:Promotie A]

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T18:59:38+00:00Added an answer on June 13, 2026 at 6:59 pm

    Call actiuneInstance.validate() and then look at the actiuneInstance.errors object to see the result of any validation errors on your object.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm stuck on a problem I really don't know how to solve: I have
I have a problem which I don't really know how to solve. I have
This is not really a question because I just solved the problem, but I
Someone posted something similar but it didn't really solve the problem. I want to
I'm writing a quick server app for something so don't really want to write
My employer wants to sell sexy applications which means they don't really want the
I wonder how the following could be solved with a mysql query, but don't
(I looked for an answer, but nothing really solved my issue so far.) I
can someone help me debug this please??? i'm really don't know whats wrong with
maybe it has been solved somewhere on this website but I did not find

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.