JSF and HTML input fields -
i have situation haven't found questions on yet.
basically, had use twitter-bootstrap typeahead on input field.
however, input field jsf inputtext field this:
<h:inputtext id="arrivalairport" value="#{searchflightsbean.arrivalairport}" styleclass="input-block-level blue-highlight" placeholder="enter arrival city"> </h:inputtext>
unfortunately, twitter-bootstrap typeahead doesn't work jsf inputtext fields - @ least, wasn't able working(if there is way that, please let me know in comment!).
i had use normal input field inside jsf form, this:
<input data-provide="typeahead" value="#{searchflightsbean.departureairport}" class="input-override input-block-level blue-highlight airportsearch" placeholder="enter departure city"> </input>
i got working typeahead code.
one problem: bean doesn't normal input field's value - that's reason using jsf in first place.
i need use normal input field typeahead js, , need use jsf inputtext field in order value bean.
is there way me this?
i worked around problem setting id , name attributes on input field so:
<input id="arrivalairport" name="arrivalairport" value="#{searchflightsbean.arrivalairport}" class="input-block-level blue-highlight" placeholder="enter arrival city"> </input>
after doing that, had in bean following:
httpservletrequest req = (httpservletrequest) facescontext.getcurrentinstance().getexternalcontext().getrequest(); string arrivaleairport = req.getparameter("arrivalairport");
the above code worked me, though i'm not sure work if there more 1 button.
Comments
Post a Comment