私はjsfでオートコンプリートにajaxリクエストを使用しています.Webサイトの他の場所をクリックすると、オートコンプリートの提案が消えます. onblur を使用し、スクリプトを呼び出して表示を none に変更していますが、スクリプトが機能していないようです。
これは私の xhtml のオートコンプリート コードです。
<rich:autocomplete id="test" required="true" onblur="hidebox()" requiredMessage="Field is blank" mode="cachedAjax"
minChars="3" value="#{action.do.testmethod}" autocompleteMethod="#{action.autocomplete}">
</rich:autocomplete>
これは非表示ボックスのコードです:
<script type="text/javascript">
function hidebox() {
alert("Test");
document.getElementById('test').style.display = "none";
}
</script>