mardi 16 février 2016

spring form checkbox tag does it allow disabled expression

I have the following form:checkbox tag in my spring MVC application

<form:checkboxes path="barriers" items="${testDto.barriers}" element="label class='block-label'" 
                        itemLabel="barrier" itemValue="id" />

This is backed by a list of barrier objects of which one of the properties is display.

In the DTO I have this field with getters and setters

private List<Barrier> barriers;

In the barrier object I have a display field

public String getDisplay() {
    return display;
}

public void setDisplay(String display) {
    this.display = display;
}

Is there a way that I can disable the checkbox if the display property is set to 'N'. there is a disabled attribute in the checkbox tag but i am not sure of the syntax that should go in there if any.

Thanks




Aucun commentaire:

Enregistrer un commentaire