* @param dcValues
* The field's pre-existing values.
*/
private void renderSelectFromListField(List form, String fieldName, DCInput dcInput, DCValue[] dcValues, boolean readonly) throws WingException
{
Field listField = null;
//if repeatable, this list of fields should be checkboxes
if (dcInput.isRepeatable())
{
listField = form.addItem().addCheckBox(fieldName);
}
else //otherwise this is a list of radio buttons
{
listField = form.addItem().addRadio(fieldName);
}
if (readonly)
{
listField.setDisabled();
}
// Setup the field
listField.setLabel(dcInput.getLabel());
listField.setHelp(cleanHints(dcInput.getHints()));
if (dcInput.isRequired())
listField.setRequired();
if (isFieldInError(fieldName))
if (dcInput.getWarning() != null && dcInput.getWarning().length() > 0) {
listField.addError(dcInput.getWarning());
} else {
listField.addError(T_required_field);
}
//Setup each of the possible options
java.util.List<String> pairs = dcInput.getPairs();