Commit 42dbdaf6 by Nilu

remove datainput handler for job match page radio buttons and handle it manually

parent c804565a
......@@ -49,9 +49,12 @@
</oneit:button>
</li>
<li class="<%= pageNumber == "3" ? "active" : isAssesmentComplete ? "complate" : ""%>">
<oneit:button value=" " name="gotoPage" skin="link" disabled="<%= isAssesmentComplete ? "true" : "false"%>"
<oneit:button value=" " name="save" skin="link" disabled="<%= isAssesmentComplete ? "true" : "false"%>"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", thirdPage)
.mapEntry("procParams", CollectionUtils.mapEntry("JobApplication", jobApplication).toMap())
.mapEntry ("restartProcess", Boolean.TRUE)
.mapEntry(NotificationUtils.DISPLAY_NOTIFICATION_PARAM, false)
.mapEntry("attribNamesToRestore", Collections.singleton("JobApplication"))
.toMap() %>">
<span><%= isAssesmentComplete ? "<img src=\"images/right-mark.png\" />" : (includeAssessment ? "3" : "2")%></span>
<div class="mobile-hide">Your Work Style</div>
......
......@@ -24,8 +24,7 @@
String exitPage = WebUtils.getArticleLink(request, objTran, WebUtils.APPLY_JOB, "Page") + "&id=" + job.getID() + "&key=" + job.getRandomKey();
String currentPage = WebUtils.getArticleLink(request, objTran, WebUtils.JOB_APPLICATION, "JobMatchAssessment");
String nextPage = WebUtils.getArticleLink(request, objTran, WebUtils.JOB_APPLICATION, "SubmitApplication");
jobApplication = (JobApplication) jobApplication.getInTransaction (objTran);
String culturePage = WebUtils.getArticleLink(request, objTran, WebUtils.JOB_APPLICATION, "WorkplaceCulture");
%>
<oneit:form name="editApplication" method="POST">
......@@ -65,24 +64,10 @@
<div class="main-sc-section main-rate-section">
<%
FormTag applicationForm = FormTag.getActiveFormTag(request);
FormBuilder formBuilder = applicationForm.getFormBuilder();
int totNoOfQuestions = totalQuestions.size();
if(actualNumber <= totNoOfQuestions)
{
Answer answer = jobApplication.getAnswerForQuestion(question);
if(answer == null)
{
answer = Answer.createAnswer(objTran);
jobApplication.getCandidate().addToProfileAssessmentAnswers(answer);
answer.setQuestion(question);
}
String optionKey = WebUtils.getInputKey(request, answer, Answer.FIELD_AnswerNo);
String formValue = formBuilder.fieldValue (optionKey, answer.getAnswerNo() == null ? "" : String.valueOf(answer.getAnswerNo()));
String numberText = actualNumber + "/" + totNoOfQuestions;
boolean completeApplication = questionNumber + 1 >= allQuestions.size();
......@@ -128,13 +113,11 @@
<%
for(int index=1; index <= (questionType == QuestionType.SCALAR ? 7 : 5); index++)
{
String activeStr = (CollectionUtils.equals(String.valueOf(index), formValue) ? "active " : "");
String selectedStr = (CollectionUtils.equals(String.valueOf(index), formValue) ? "checked" : "");
int actNumber = questionType == QuestionType.SCALAR ? actualNumber + 1 : actualNumber + 2;
%>
<li class="<%= activeStr + ((questionType == QuestionType.SCALAR) ? "scaler" : "ipsative")%>">
<li class="<%=((questionType == QuestionType.SCALAR) ? "scaler" : "ipsative")%>">
<a href="javascript:void(0);">
<input type="radio" name="<%= optionKey %>" id="<%= index %>" onchange="gotoNextQuestion(<%= questionNumber + 1 %> , <%= actNumber %>, <%= completeApplication %>, <%= answer.getFinalAnswerValue(index) %>);" class="answer_radio" value="<%= answer.getFinalAnswerValue(index) %>" <%= selectedStr %>>
<input type="radio" name="answer" id="<%= index %>" onchange="gotoNextQuestion(<%= questionNumber + 1 %> , <%= actNumber %>, <%= completeApplication %>, <%= index %>);" class="answer_radio">
<label for="<%= index %>"><%= index %></label>
</a>
</li>
......@@ -161,12 +144,28 @@
}
%>
</div>
<oneit:button value="Submit Application" name="completeApplication" id="gotoPageNext" cssClass="box-btn hide"
<%
if(!jobApplication.cultureCompleted())
{
%>
<oneit:button value=" " name="gotoPage" id="gotoPageNext" cssClass="box-btn"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", culturePage)
.mapEntry ("restartProcess", Boolean.TRUE)
.mapEntry("attribNamesToRestore", Collections.singleton("JobApplication"))
.toMap() %>"/>
<%
}
else
{
%>
<oneit:button value=" " name="completeApplication" id="gotoPageNext" cssClass="box-btn hide"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", nextPage)
.mapEntry ("restartProcess", Boolean.TRUE)
.mapEntry("attribNamesToRestore", Collections.singleton("JobApplication"))
.toMap() %>"/>
<%
}
%>
</oneit:evalBody>
</oneit:form>
\ No newline at end of file
......@@ -28,9 +28,15 @@
Filter<Answer> filter = Answer.SearchByAll().andQuestion(new EqualsFilter<>(question));
Answer answer = jobApplication.pipelineJobApplication().toCandidate().toProfileAssessmentAnswers(filter).val();
DataMap dataMap = DataMap.getDataMap(request, true);
dataMap.removeORMHandlersForObject(answer);
if(answer == null)
{
answer = Answer.createAnswer(objTran);
answer.setAnswerNo(answerNo);
jobApplication.getCandidate().addToProfileAssessmentAnswers(answer);
answer.setQuestion(question);
}
answer.setAnswerNo(answer.getFinalAnswerValue(answerNo));
%>
</oneit:form>
\ No newline at end of file
......@@ -17,11 +17,20 @@
if(jobAppId != null)
{
jobApplication = JobApplication.getJobApplicationByID(objTran, jobAppId);
process.setAttribute("JobApplicationID" , jobApplication.getID().longValue());
}
if(jobApplication == null)
{
jobApplication = (JobApplication) process.getAttribute("JobApplication");
}
Debug.assertion(jobApplication != null, "Job Application cannot be null in applicant portal - job match assessment ");
if(process.getAttribute("JobApplicationID") == null)
{
process.setAttribute("JobApplicationID" , jobApplication.getID().longValue());
}
Job job = jobApplication.getJob();
Candidate candidate = jobApplication.getCandidate();
int questionNumber = jobApplication.getQuestionNumber();
......@@ -67,6 +76,12 @@
function gotoNextQuestion(questionNumber, actualNumber, completeApplication, answerNo)
{
var radioid = "#" + answerNo;
$(radioid).closest('li').addClass(" active ");
setTimeout(
function() {
ajaxProcessAddJQ ("<%= request.getContextPath() %>/extensions/applicantportal/inc/save_job_match_answers.jsp", 'form' ,
{questionNumber : questionNumber, answerNo: answerNo, actualNumber: actualNumber, completeApplication: completeApplication},
function () {},
......@@ -90,6 +105,8 @@
ajaxProcessAddJQ ("<%= request.getContextPath() %>/extensions/applicantportal/inc/job_match_questions.jsp", '.job-match-questions' , {questionNumber : questionNumber, actualNumber: actualNumber});
$('.timer').countimer('start');
},
500); // delay in order to visually reinforce selection before advancing
}
</script>
......
......@@ -200,7 +200,7 @@
.mapEntry(UpdateMappedObjFP.FAIL_VALIDATION_ERRORS, Boolean.FALSE)
.toMap() %>"/>
<%
if(isAssesmentComplete)
if(isLast && isAssesmentComplete)
{
%>
<oneit:button value="Complete" name="completeApplication" id="nextButton" cssClass="box-btn"
......@@ -226,7 +226,6 @@
.mapEntry("procParams", CollectionUtils.mapEntry("JobApplication", jobApplication).toMap())
.mapEntry ("restartProcess", Boolean.TRUE)
.mapEntry(NotificationUtils.DISPLAY_NOTIFICATION_PARAM, false)
.mapEntry("attribNamesToRestore", Collections.singleton("JobApplication"))
.toMap() %>"/>
<%
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment