Compare commits
1 Commits
348afe1723
...
164271a6e5
Author | SHA1 | Date | |
---|---|---|---|
164271a6e5 |
view/src/main/java/se/su/dsv/scipro/match
@ -22,15 +22,7 @@ public class IdeaTholanderCompletionPanel extends Panel {
|
||||
|
||||
private void textField(String id, IModel<String> model) {
|
||||
TextArea<String> textArea = new TextArea<>(id, model);
|
||||
textArea.add(
|
||||
new StringValidator(null, TholanderBox.MAX_CHARS) {
|
||||
@Override
|
||||
protected boolean hasLengthAttribute(String tagName) {
|
||||
// remove the maxlength attribute from the tag to disable client side validation
|
||||
return false;
|
||||
}
|
||||
}
|
||||
);
|
||||
textArea.add(StringValidator.maximumLength(TholanderBox.MAX_CHARS));
|
||||
textArea.setRequired(true);
|
||||
add(textArea);
|
||||
|
||||
|
@ -17,7 +17,14 @@
|
||||
an idea if you couldn't find any suitable supervisor provided ideas.
|
||||
</div>
|
||||
|
||||
<form wicket:id="ideaForm">
|
||||
<!--
|
||||
Turn off all client-side validation using novalidate.
|
||||
All input is validated server-side, and we want to validate it
|
||||
that way to get nice error messages.
|
||||
However, we also want to maintain the required/minlength/whatever
|
||||
attributes on the input fields for accessibility.
|
||||
-->
|
||||
<form wicket:id="ideaForm" novalidate>
|
||||
<div class="mb-3">
|
||||
<label class="col-form-label" wicket:for="title">Title</label>
|
||||
<p class="form-text">
|
||||
|
@ -307,15 +307,7 @@ public class ProjectIdeaSubmissionPanel extends GenericPanel<Idea> {
|
||||
LambdaModel.of(getModel(), Idea::getTitle, Idea::setTitle)
|
||||
);
|
||||
title.setRequired(true);
|
||||
title.add(
|
||||
new StringValidator(MIN_TITLE_LENGTH, null) {
|
||||
@Override
|
||||
protected boolean hasLengthAttribute(String tagName) {
|
||||
// remove the minlength attribute from the tag to disable client side validation
|
||||
return false;
|
||||
}
|
||||
}
|
||||
);
|
||||
title.add(StringValidator.minimumLength(MIN_TITLE_LENGTH));
|
||||
add(new ComponentFeedbackPanel("titleFeedback", title));
|
||||
add(title);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user