Hi all,

I'm just wondering whether there is a simple and elegant way of making certain BeanEditForm fields 'read only' within the controller class, rather than in the view template? In certain circumstances I wish to dynamically prevent users from modifying certain fields (a pretty common scenario).

It would be nice to inject a field component in the controller, and simply invoke setReadOnly() to have it display its value within the BeanEditForm, but grayed out and unable to be altered. These fields are all 'Select' type in my case.

The Select component has a 'disabled' parameter, but I suspect a disabled field would behave quite differently—possibly not even displaying its value.

Below is an example field taken from the template.

    <p:vesselSelected>
        <div class="form-group">
            <label t:type="label" t:for="vessel"/>
<select t:type="select" t:id="vessel" t:value="vesselSelected" t:model="vesselSelectModel" t:label="message:label.vessel"/>
        </div>
    </p:vesselSelected>

Regards,

Chris.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to