2014-01-13 1 views
0

두 드롭 다운에 대해 동적으로 채워진 목록이 있습니다. 첫 번째 드롭 다운두 번째 드롭 다운이 첫 번째 드롭 다운의 선택된 옵션에 따라 동적으로 채워지는 동안 작업 영역 목록을 선택합시다. 이 태그를 사용하여 데이터를 저장하면 모든 것이 잘되지만 기존 데이터를 편집 할 때 두 번째 드롭 다운을 사용하면 옵션이 삭제되지 않습니다. struts 2가 두 번째 드롭 다운 값에 가치를 부여하려고 할 때 문제가 있다고 생각합니다. 그리고 웹 콘솔에서이 오류를 발견했습니다.Struts 2 <s : doubleselect> 태그 캐치되지 않음 TypeError : 정의되지 않은 'applicant_jobTitle'속성을 읽을 수 없음

"catch되지 않는 형식 오류가 : 정의의 특성 'applicant_jobTitle'을 읽을 수 없습니다"

이 내 JSP입니다

<s:doubleselect label="Job Applied" required="true" 
headerKey="-1" headerValue="Select Job Area" 
     name="applicant.jobArea"   list="listJobArea.keySet()  
doubleName="applicant.jobTitle" doubleList="listJobArea.get(top)"  
formName="formApplicant"/> 

이 내 HTML

<form action="updateApplicant" class="class java.util.HashMap" enctype="multipart/form-data" method="post"> 

<p> 
<s:hidden cssClass="textfield" name="applicant.applicantNo" /> 
<s:hidden cssClass="textfield" name="applicant.dateAdded" /> 
<s:hidden cssClass="textfield" name="applicant.status" /> 
</p> 
<p> 
<s:textfield cssClass="textfield" name="applicant.firstName" required= "true" 
    label="Firstname" /> 
</p> 
<p> 
<s:textfield cssClass="textfield" name="applicant.lastName" required= "true" 
    label="Lastname" /> 
</p> 
<br> 
<p> 
<s:textfield cssClass="textfield" required= "true" name="applicant.email" label="Email" /> 
</p> 
<br> 
<p> 
<s:textfield cssClass="textfield" name="applicant.contactNo" required= "true" 
    label="Contact Number" /> 
</p> 
<br> 
<s:doubleselect label="Job Applied" required="true" 
     headerKey="-1" headerValue="Select Job Area" 
      name="applicant.jobArea"   list="listJobArea.keySet()  
     doubleName="applicant.jobTitle" doubleList="listJobArea.get(top)"  
     formName="formApplicant"/> 
입니다;> applicant_jobAreaRedirect (1) -
<input type="submit" id="submit" name="action:cancel" value="Cancel" >  
    <input value="Update" type="submit" name="submit" /> 

이 6,

2 태그를 스트럿 doubleselect

에서 오류가 줄에 표시됩니다

자동 생성 기능인 자바 스크립트이고

<script type="text/javascript"> 
var applicant_jobAreaGroup = new Array(2 + 1); 
for (i = 0; i < (2 + 1); i++) 
applicant_jobAreaGroup[i] = new Array(); 

applicant_jobAreaGroup[1][0] = new Option("Select Job Title", "Select Job Title"); 

applicant_jobAreaGroup[1][1] = new Option("Application Architect", "Application Architect"); 

applicant_jobAreaGroup[1][2] = new Option("Business Architect", "Business Architect"); 

applicant_jobAreaGroup[2][0] = new Option("Select Job Title", "Select Job Title"); 

applicant_jobAreaGroup[2][1] = new Option("Application Consultant", "Application Consultant"); 

applicant_jobAreaGroup[2][2] = new Option("Engagement Manager", "Engagement Manager"); 

applicant_jobAreaGroup[2][3] = new Option("General Other Consultant", "General Other Consultant"); 


var applicant_jobAreaTemp = document.formApplicant.applicant_jobTitle; 
applicant_jobAreaRedirect(1); 
function applicant_jobAreaRedirect(x) { 
    var selected = false; 
    for (m = applicant_jobAreaTemp.options.length - 1; m >= 0; m--) { 
     applicant_jobAreaTemp.options[m] = null; 
    } 

    for (i = 0; i < applicant_jobAreaGroup[x].length; i++) { 
     applicant_jobAreaTemp.options[i] = new Option(applicant_jobAreaGroup[x][i].text, applicant_jobAreaGroup[x][i].value); 
      if (applicant_jobAreaTemp.options[i].value == 'Application Architect') { 
       applicant_jobAreaTemp.options[i].selected = true; 
       selected = true; 
      } 
    } 

    if ((applicant_jobAreaTemp.options.length > 0) && (! selected)) { 
     applicant_jobAreaTemp.options[0].selected = true; 
    } 
} 

내 doubleselect 태그 또는이 자바 스크립트를 수정하는 방법에 문제가 있습니까? 또는 double.ftl을 수정하거나 가져 오는 방법은 무엇입니까?

+0

관련 HTML 코드를 게시 할 수 있습니까? –

+0

나는 HTML 코드 @RomanC를 추가 할 것이다. – user3189520

답변

0

방금 ​​jsp에서 한 양식의 이름을 추가했습니다. 작성하는 것을 잊어 버린 것처럼 보입니다.

관련 문제