我想更新我的组件值 evry 10 keyup ,所以我编写了以下代码:
<h:body>
//***************************JAVAScript function**************
<SCRIPT LANGUAGE="JavaScript">
function fnc(){
length=document.getElementById("aa").value.length;
if(length == 10)
{
document.getElementById("aa").value ="";
}
}
<ui:composition template="commonLayout.xhtml">
<ui:define name="content">
<section id="main" class="column">
<h4 class="alert_info">Scannez les bonbonnes puis cliquez sur
enregistrer :</h4>
<div class="Saut20px">
<h:form id="form">
<p:panel id="panel" header="Register">
<br />
<p:focus context="panel" />
<p:growl id="msgs"></p:growl>
<h:outputLabel value="Code Barre :" />
//*****************call function in onComplete******
<p:inputText id="aa" value="#{bonBonneManagedBean.sel}">
<p:ajax event="keyup" update="koko msgs" oncomplete="fnc()"
listener="#{bonBonneManagedBean.ajouterSelected(bonBonneManagedBean.sel)}" />
</p:inputText>
但是电话打不通,如果你能帮我找到错误,提前谢谢你