Render field as read only using the Grails Fields Plugin -


using fields plugin:

<f:field bean="operator" property="defaultpaymentmethod"/> 

renders nicely label "default payment method" , input box.

how can (what best way) show field , not allow user change value?

  • f:display shows value, no label.

  • i tried writing wrapper this:

    <div class="fieldcontain required"><label for="${property}"> <g:message code="${entityname}.${property}.label" default="${property}"/> <span class="required-indicator">*</span> </label><g:field type="text" name="${property}" readonly="readonly" value="${value}"/> </div>

but didn't come out nice label formatting.

is there way make field read grails fields plugin?

use f:display show value:

<f:display bean="operator" property="defaultpaymentmethod"/> 

if still want keep of input-field, can use attribute: disabled="true" in f:field tag.

edit: "disabled="true" in f:field tag" not working


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -