I have developed jQuery autocomplete with JSF and it's working fine, but when I add h:form
it's not working.
This is my code.
<script>
/* auto complete */
$(function() {
var availableTags = "#{instrumentBean.instrumentList}";
$("#tags").autocomplete({
source: availableTags
});
});
</script>
<div class="ui-widget">
<h:form> <!-- this form was missing -->
<label for="tags">Symbol: </label>
<h:inputText id="tags" />
<h:form id="watchListForm">
<h:commandButton action="#{watchListBean.addtowatchList}"
value="ADD TO WATCH LIST"/>
</h:form>
</div>
With above code autocomplete is working fine, but when I put h:inputbox
inside h:form
it's not working. Without putting it in h:form
I'm not able to submit it's value to JSF backing bean. Please give me valuable idea to get this correct.
Thanks in advance