Require authors to fill in background, literature, problem, method, and interests when submitting ideas #72
@ -18,6 +18,7 @@ import org.apache.wicket.model.*;
|
||||
import org.apache.wicket.model.util.ListModel;
|
||||
import org.apache.wicket.model.util.SetModel;
|
||||
import org.apache.wicket.request.mapper.parameter.PageParameters;
|
||||
import org.apache.wicket.util.value.IValueMap;
|
||||
import org.apache.wicket.validation.validator.StringValidator;
|
||||
import se.su.dsv.scipro.components.*;
|
||||
import se.su.dsv.scipro.generalsystemsettings.GeneralSystemSettings;
|
||||
@ -187,7 +188,17 @@ public class ProjectIdeaSubmissionPanel extends GenericPanel<Idea> {
|
||||
LambdaModel.of(getModel(), Idea::getProjectType, Idea::setProjectType),
|
||||
projectTypes,
|
||||
new LambdaChoiceRenderer<>(ProjectType::getName, ProjectType::getId)
|
||||
);
|
||||
) {
|
||||
@Override
|
||||
protected IValueMap getAdditionalAttributes(int index, ProjectType choice) {
|
||||
IValueMap valueMap = super.getAdditionalAttributes(index, choice);
|
||||
// Have to remove the client side validation for required
|
||||
// to have this field behave like all the others on the form.
|
||||
// Can't remove the call to #setRequired(true) as it is needed for server side validation.
|
||||
valueMap.remove("required");
|
||||
return valueMap;
|
||||
}
|
||||
};
|
||||
projectTypeChoice.add(
|
||||
new AjaxFormChoiceComponentUpdatingBehavior() {
|
||||
@Override
|
||||
|
Loading…
x
Reference in New Issue
Block a user