Skip to content

Commit

Permalink
IQSS#4393 fixes from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
sekmiller committed Jan 11, 2018
1 parent e916af0 commit 5c5b19b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,22 +161,22 @@ private boolean validateGuestbookResponse(GuestbookResponse guestbookResponse){
new FacesMessage(FacesMessage.SEVERITY_ERROR, BundleUtil.getStringFromBundle("dataset.guestbookResponse.guestbook.responseTooLong"), null));
}
if (dataset.getGuestbook().isInstitutionRequired()) {
boolean institutionValid = (guestbookResponse.getEmail() != null && !guestbookResponse.getEmail().isEmpty());
boolean institutionValid = (guestbookResponse.getInstitution()!= null && !guestbookResponse.getInstitution().isEmpty());
if (!institutionValid) {
institutionField.setValid(false);
FacesContext.getCurrentInstance().addMessage(institutionField.getClientId(),
new FacesMessage(FacesMessage.SEVERITY_ERROR, BundleUtil.getStringFromBundle("requiredField"), null));
}
valid &= institutionValid;
}
valid &= testResponseLength(guestbookResponse.getInstitution());
valid &= testResponseLength(guestbookResponse.getInstitution());
if (! testResponseLength(guestbookResponse.getInstitution())){
institutionField.setValid(false);
FacesContext.getCurrentInstance().addMessage(institutionField.getClientId(),
new FacesMessage(FacesMessage.SEVERITY_ERROR, BundleUtil.getStringFromBundle("dataset.guestbookResponse.guestbook.responseTooLong"), null));
}
if (dataset.getGuestbook().isPositionRequired()) {
boolean positionValid = (guestbookResponse.getEmail() != null && !guestbookResponse.getEmail().isEmpty());
boolean positionValid = (guestbookResponse.getPosition()!= null && !guestbookResponse.getPosition().isEmpty());
if (!positionValid) {
positionField.setValid(false);
FacesContext.getCurrentInstance().addMessage(positionField.getClientId(),
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/file-download-popup-fragment.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
<ui:repeat value="#{guestbookResponse.customQuestionResponses}" var="customQuestionResponse">
<div class="text-left">
<label class="control-label">
<h:outputText value="#{customQuestionResponse.customQuestion.questionString}"/>
<h:outputText value="#{customQuestionResponse.customQuestion.questionString} "/>
<span class="glyphicon glyphicon-asterisk text-danger" jsf:rendered="#{customQuestionResponse.customQuestion.required}" />
</label>
<p:inputText id="customQuestionResponse"
Expand Down

0 comments on commit 5c5b19b

Please sign in to comment.