5
JSF로 데이터 테이블을 설정하려고합니다. 행에있는 모든 상자의 행 전체를 합계하는 행 합계 상자가 있습니다. onChange의 JSF 액션
<tr id="input_row_1">
<td id="mondayInput1">
<h:inputText id="monday1" size="4" value="#{timesheet.monday1}" required="false" />
<!-- <input name="monday1" class="smallInput" type="number" size="2" maxlength="4" min="0"/> -->
</td>
<td id="tuesdayInput1">
<h:inputText id="tuesday1" size="4" value="#{timesheet.tuesday1}" required="false" />
<!--<input name="tuesday1" class="smallInput" type="number" size="2" maxlength="4" min="0"/> -->
</td>
<td id="wednesdayInput1">
<h:inputText id="wednesday1" size="4" value="#{timesheet.wednesday1}" required="false" />
<!--<input name="wednesday1" class="smallInput" type="number" size="2" maxlength="4" min="0"/> -->
</td>
<td id="thursdayInput1">
<h:inputText id="thursday1" size="4" value="#{timesheet.thursday1}" required="false" />
<!--<input name="thursday1" class="smallInput" type="number" size="2" maxlength="4" min="0"/> -->
</td>
<td id="fridayInput1">
<h:inputText id="friday1" size="4" value="#{timesheet.friday1}" required="false" />
<!--<input name="friday1" class="smallInput" type="number" size="2" maxlength="4" min="0"/> -->
</td>
<td id="saturdayInput1">
<h:inputText id="saturday1" size="4" value="#{timesheet.saturday1}" required="false" />
<!--<input name="saturday1" class="smallInput" type="number" size="2" maxlength="4" min="0"/> -->
</td>
<td id="sundayInput1">
<h:inputText id="sunday1" size="4" value="#{timesheet.sunday1}" required="false" />
<!--<input name="sunday1" class="smallInput" type="number" size="2" maxlength="4" min="0"/> -->
</td>
<td>
<h:inputText id="total1" size="4" value="#{timesheet.total1}" required="false" />
<!-- <input name="total1" id="total1" type="text" size="5" readonly="readonly" /> -->
</td>
그래서 내가 처음 일 항목에
onChange="#{timesheet.setTotal1}"
을 추가하려고하지만 OnChange 이벤트는 자바 스크립트가 아닌 자바/JSF 코드를 호출과 같은 행이 보인다. 누군가가 전체 업데이트를 도울 수 있습니까?
이 편집 : 나는 BalusC의 답변을 수용하지만, 필요 또한 실제로 그렇게
<h:inputText id="friday1" size="4" value="#{timesheet.friday1}" maxlength="4" required="false" >
<f:ajax event="change" render="total1" listener="#{timesheet.updateTotal1}" />
</h:inputText>
와
나는 이런 짓을하고 지금은 무엇입니까 : "javax.servlet.ServletException : 부동산의 'updateTotal1'형 com.timesheet.Timesheet을 찾을 수 없습니다"updateTotal1이 재산 인 것처럼 메소드/액션이 아닌 –
''에서 의미하는 것은 무엇입니까? 분명히'f :'taglib의 XML 네임 스페이스는 전혀 선언되지 않았다. ' '태그 전체는 실제로 "일반 텍스트"로 취급됩니다 (읽기 : EL은 값 표현식으로 처리됩니다). –
BalusC
그러나 선언되었습니다. html 코드 –