public WorkspacePanel(final String id, final IModel workspaceModel, final IModel paramLabelModel, final boolean required) { // make the value of the combo field the model of this panel, for easy // value retriaval super(id, workspaceModel); // the label String requiredMark = required ? " *" : ""; Label label = new Label("paramName", paramLabelModel.getObject() + requiredMark); add(label); // the drop down field, with a decorator for validations choice = new DropDownChoice("paramValue", workspaceModel, new WorkspacesModel(), new WorkspaceChoiceRenderer()); choice.setRequired(required); // set the label to be the paramLabelModel otherwise a validation error would look like // "Parameter 'paramValue' is required" choice.setLabel(paramLabelModel); FormComponentFeedbackBorder feedback = new FormComponentFeedbackBorder("border"); feedback.add(choice); add(feedback); }
public WorkspacePanel( final String id, final IModel workspaceModel, final IModel paramLabelModel, final boolean required) { // make the value of the combo field the model of this panel, for easy // value retriaval super(id, workspaceModel); // the label String requiredMark = required ? " *" : ""; Label label = new Label("paramName", paramLabelModel.getObject() + requiredMark); add(label); // the drop down field, with a decorator for validations choice = new DropDownChoice( "paramValue", workspaceModel, new WorkspacesModel(), new WorkspaceChoiceRenderer()); choice.setRequired(required); // set the label to be the paramLabelModel otherwise a validation error would look like // "Parameter 'paramValue' is required" choice.setLabel(paramLabelModel); FormComponentFeedbackBorder feedback = new FormComponentFeedbackBorder("border"); feedback.add(choice); add(feedback); }