Combining twitter typeahead with JSF inputText -
snippet of html:
<h:panelgrid width="100%"> <h:outputtext value="from:"></h:outputtext> <h:inputtext id="departureairport" value="#{searchflightsbean.departureairport}" styleclass="input-block-level blue-highlight" placeholder="enter departure city" required="true"> <f:validatelength minimum="3" maximum="20" /> </h:inputtext> <h:message for="departureairport" styleclass="alert alert-error" /> </h:panelgrid>
i want to, eventually, pull data field via ajax, , suggest options user while he/she typing.
i have included following in page:
<h:outputstylesheet name="css/bootstrap.css" /> <h:outputstylesheet name="css/main.css" /> <h:outputscript name="js/jquery-2.0.2.min.js" /> <h:outputscript name="js/bootstrap-typeahead.js" />
and have following js, i'm using test autocompletion:
$(document).ready(function () { $('#departureairport').typeahead([ { name: 'planets', local: [ "mercury", "venus", "earth", "mars", "jupiter", "saturn", "uranus", "neptune" ] }]); });
the autocompletion not working. know why, exactly? got typeahead example here, if interested.
it seems jsf , twitter-bootstrap don't play together. got working noraml input field.
Comments
Post a Comment