메서드 호출을 통해 Primafaces 출력 레이블을 채우는 것에 대한 질문이 있습니다. 이 방법에는 매개 변수가 필요했습니다.Primefaces OutputLabel을 매개 변수로 채우기
내 백업의 콩에서<p:dataTable id="answerToQuestionDialogTable" var="answer" value="#{allQuestionBean.answers}">
<p:column headerText="Counts For this Answer">
<p:outputLabel value="#{allQuestionBean.votingCounter}">
<f:param name="id" value="#{answer.answerId}"/>
</p:outputLabel>
</p:column>
</p:dataTable>
내가 따라 게터와 정수 필드 명 "votingCounter"이 :
레이블은 다음과 같다 내가 사이트를로드하려고하면
public int getVotingCounter() {
Map<String, String> params = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap();
int answerID = Integer.parseInt(params.get("id"));
return answeredDAO.getCountForAnswer(answerID);
}
를 내가 내 AppServer (Tomcat 6)에서 LogOutput을 얻으십시오.
04.09.2012 04:30:47 com.sun.faces.context.PartialViewContextImpl$PhaseAwareVisitCallback visit
SCHWERWIEGEND: javax.el.ELException: /pages/allQuestion.xhtml @69,81 value="#{allQuestionBean.votingCounter}": Error reading 'votingCounter' on type bean.view.AllQuestionBean
왜이 원인지 설명 할 수있는 사람이 있습니까? t 작업과 나에게 내가 텍스트에 레이블을 채우는 방법을 호출하는 방법을 해결책을 줄 수 있습니까?
안녕 다니엘, 들으. 당신의 팁으로 나는 그것을 얻었습니다. 혼란스럽게 생각하는 사람이 왼쪽. 나는 Primefaces에서 출력 레이블을 가지고 시험해 보았고 항상 Nullpointer를 얻었다. 그런 다음 JSFCore의 Label과 동일한 코드가 모두 올바르게 작동합니다. – Chris