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)
when i'm creating book need author field , title field editable.
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
Post a Comment