I\'m testing the component \"SelectOneMenu\" on a jsf page. I\'m populating this component dinamically though my ManageBean (that will get all Animals from database).
<
There are many solutions to the presented problem. I present here two basic ideas.
Server-side solution. Simply attach tag inside your to update selected values and rerender user's choice, like in
If you like, you may also do some custom logic with selected element in ajax listener by specifying listener="#{animalsManage.performCustomAjaxLogic}" of tag.
Client-side solution. Simply update element with id="textbox" on basic change event. So, if you use jQuery the solution will be
$('#combo').change(function() {
$('#textbox').val($('#combo').val());
});
Thought the client-side solution will bind only text value of your input component.