2017-05-24 20 views
0

具有輸入文本字段的jsf文件。在輸入字段中的值並按下回車鍵後,它應該在命令按鈕(nextButton)中執行操作,即調用Action ()在BackingBean.java在輸入鍵上按jsf從inputtext標籤調用bean類中的方法

<html xmlns="http://www.w3.org/1999/xhtml" 
xmlns:h="http://java.sun.com/jsf/html" 
xmlns:f="http://java.sun.com/jsf/core" 
xmlns:c="http://java.sun.com/jstl/core" 
xmlns:ui="http://java.sun.com/jsf/facelets" 
xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"> 

    <ui:define id="content" name="page-content"> 
    <h:inputText id="Number" value="#{BackinBean.Id}"/> 
    </ui:define> 

    <ui:define id="contentfooter" name="page-content_footer"> 

     <table width="100%"> 
      <tr> 
       <td> 
        <h:commandButton id="nextButton" value="Next" 
         action="#{BackinBean.Action}" styleClass="btn"/> 
       </td> 
      </tr> 
     </table> 
    </ui:define> 

豆class-BackingBean.java有

public Action(){..........} 

回答