edit - Grails - Editable fields when Creating and Non-editable when Editing -


i'm using grails 2.3.x

imagine domain class: book (string author, string title)

  1. when i'm creating book need author field , title field editable.

  2. when i'm editing book need author field non-editable , title field editable

i know there domain constraint (editable: false), doesn't work second case. adds tag readonly="readonly"

i tried this: how conditionally disable form input field seems that: "${mode == 'edit'}" false.

thank much

that link provided assumes variable flag called mode passed view determine whether editing or not. this, need pass mode view controller this:

def edit(long id) {     [bookinstance: new book(), mode: 'edit'] } 

that force ${mode == 'edit'} portion true.


Comments

Popular posts from this blog

php - SPIP: From Tag directly to an article -

jquery - isAjaxRequest always return false -

ruby on rails - In a controller spec, how to find a specific tag in the generated view? -