1
我想直接從命令按鈕調用setter並傳遞一個值。我的問題是,如果將字符串作爲字符串傳回,setter將期待一個Character和jsf。有沒有一種很好的方法可以在前端解決這個問題,而不必在我的支持bean上加載setter?在字符中傳遞字符(vs傳遞字符串)到backing bean方法
的commandButton:從後臺bean
<p:commandButton value="SignOff"
actionListener="#{manageItemHandler.dataEntryOp.setBomComplete('Y')}"
rendered="#{speed2Session.isRendered('editManageItemOp')}"/>
的getter/setter:
protected Character bomComplete;
/**
* @return the bomComplete
*/
public Character getBomComplete() {
return bomComplete;
}
/**
* @param bomComplete the bomComplete to set
*/
public void setBomComplete(Character bomComplete) {
this.bomComplete = bomComplete;
}
當我單擊命令我得到
11:47:19,270 SEVERE [javax.enterprise.resource.webcontainer.jsf.context] (http-steves-172.16.8.26-15081-1) JSF1073: javax.faces.event.AbortProcessingException caught during processing of INVOKE_APPLICATION 5 : UIComponent-ClientId=centerForm:j_idt271, Message=Method not found: [email protected](java.lang.String)
11:47:19,273 SEVERE [javax.enterprise.resource.webcontainer.jsf.context] (http-steves-172.16.8.26-15081-1) Method not found: [email protected](java.lang.String): javax.faces.event.AbortProcessingException: Method not found: [email protected](java.lang.String)
謝謝你(一如既往)的行爲的徹底解釋和給出多種可能的解決方案。 – SteveS
不客氣。 – BalusC