<script>
var rejectVal = 50;
function textCounter(){
rejectVal = 51;
}
</script>
<p:commandButton
oncomplete = "if(rejectVal==51) PF('#hidePanel').hide()"
action = "#{abcBean.update}"
onclick = "PF('#updatePanel').show()">
</p:commandButton>
<h:inputTextarea
value = "#{abcBean.value}"
onKeyDown= "textCounter()">
</h:inputTextarea>
问题在oncomplete方法中,尽管它在textCounter方法中更新为51,但我没有得到rejectVal的值
这个问题基本上不是很好(实际上非常糟糕)。