Struts 1 양식에 문제가 있습니다. 논리가 포함되어 있습니다. 입력 버튼이있는 행을 작성하는 과정을 반복합니다.Struts 1 - 행 제출
<html:form action="/myAction" styleClass="centeredForm" style="display:inline" >
<td class="formLabel">City</td>
<td class="formControl">
<bean:define id="cities" name="myForm"
property="cities" type="java.util.Collection"/>
<html:select styleClass="dashSelect" property="city">
<html:option value="">All Cities</html:option>
<html:options collection="cities"
property="id" labelProperty="value"/>
</html:select>
</td>
... Other elements ...
<logic:iterate id="myObject" name="myForm" property="myObjects" indexId="index" type="com.test.MyObject">
<% String rowClass = index.intValue() % 2 == 0 ? "even-row" : "odd-row"; %>
<tr class="<%=rowClass%>">
<td class="result-cell"><bean:write name="myObject" property="id" /> </td>
<td class="result-cell"><bean:write name="myObject" property="name" /> </td>
<td class="result-cell">
<html:select styleClass="dashSelect" name="myObject" property="status">
<html:option value="F">Disabled</html:option>
<html:option value="T">Enabled</html:option>
</html:select>
</td>
<td>
<html:submit/>
</td>
은 "도시"부분과 : I 버튼을 제출 그 중 하나를 쳤을 때 문제가 온다, 동적 데이터가 제대로 배치되지 않는 양식은 그 가치가없는, 여기 예제 논리 외부에서 쉬어 라. "myForm"을 잘 반복해라. 그러나 "myObject"는 그렇지 않다. JavaScript 함수를 사용하여이 작업을 시도했지만 제대로 작동하지 못했습니다. 현재, 내가 가지고있는 것 (그 html : 레퍼런스로 남겨둔 제출)은 POST에 "상태"매개 변수와 내가 전에 언급 한 적절한 값을 포함하고 있습니다.
누구든지이 문제에 대해 의견을 개진 할 수 있습니까?
추가 정보가 필요하면 알려주십시오.
미리 감사드립니다.
무슨 뜻인지 확실하지 않습니다. 당신은'indexed' 태그 ([here] (http://struts.apache.org/1.2.7/faqs/indexedprops.html) 참조) 나 중첩 된 태그를 사용하지 않고 수동으로 인덱스 된 속성 이름을 만들지 않습니다. 그래도 작동하지 않는 것에 대해서는 완전히 명확하지 않습니다. (태그/콩 중 일부에서 많은 노력이 필요해 보이지만, 오래된 컨테이너를 사용하는 경우 JSP EL 또는 적어도 EL Struts 태그를 사용 해본 적이 있습니까?) –
문제는 제출하면 양식에 "myObject"가 채워지지 않습니다. 논리는 반복을 통해 만드는 모든 행에 대한 정보입니다. 그동안 색인 생성 된 태그를 살펴 보겠습니다. – LdSe