添加<f:ajax event="blur"...
或<f:ajax event="keyup"...
像这样
<h:inputText id="text1" value="#{inningBean.dismissalName}">
<f:ajax event="blur" render="typeWhatYouWant" listener="#{optionalBean.someMethod}"/>
</h:inputText>
<h:inputText id="text2" value="#{inningBean.dismissalName}">
<f:ajax event="blur" render="typeWhatYouWant" listener="#{optionalBean.someMethod}"/>
</h:inputText>
或使用 js(使用 viewsource 检查您的真实身份text1
)text2
<h:inputText id="text1" value="#{inningBean.dismissalName}" onkeyup="$('#yourFormID\\:text2').val($('#yourFormID\\:text1').value)"/>
<h:inputText id="text2" value="#{inningBean.dismissalName}" onkeyup="$('#yourFormID\\:text1').val($('#yourFormID\\:text2').value)"/>