Add dynamic property 'id'

Hi,

I've encountered a bug in the code Grails supprt: when you're in a controller, and type something like 'params.id', there's an underlne for the 'id' part, to add it to the list of dymanic properties. When you try to add it to the list of dynaic properties (alt+enter), nothing happens, and the 'id' part of the params is still not recognized, causing a lot of unnessary warnings in other pieces of the code. For example, my code looks like this:

def recipeInstance = Recipe.find("from Recipe r where r.id = ?", params.id)

Which also gives a warning:

'find' cannot be applied to (java.lang.String, null)

Can this be fixed please?

5 comments
Comment actions Permalink

Ah, allow me to rephrase: the adding of dymanic methods is just broken. I cannot add any methods/properties/variables anymore. It's broken.

0
Comment actions Permalink

What build are you using? It works fine in mine

0
Comment actions Permalink

This works fine for me, too. I've been using all of the recent builds as soon as they are announced.

But I do have a question: how can I delete a dynamic property once it has been added? (I had never tried to add a dynamic property to params since the available properties change from action to action. Now that I experimented and added it I would like to delete it but I can't figure out how. Particularly since the property is associated with Map.)

0
Comment actions Permalink

Did you try go to toolwindow "Dynamic properties" on the right side and delete item in tree (press delete on keyboard)?

0
Comment actions Permalink

Yes, the delete button works -- thanks! (And yes, I'm embarassed for not having figured that out.)

0

Please sign in to leave a comment.