In my page I have selectonemenu and I have noticed that when I click the pagination of datatable, valueChangeListener method is getting invoked without actually changing values or options in selectonemenu.
How is this happening and how could I prevent this from happening as I need to invoke valueChangeListener method only if user changes values in selectonemenu.
Thanks and appreciate any help.
Regards
Here is my code for selectonemenu
Update1
<ice:selectOneMenu value="#{list.selectedItem}"
partialSubmit="true" valueChangeListener="#{list.val}">
<f:selectItems value="#{list.selectItems}" />
</ice:selectOneMenu>
And bean method
public void val(ValueChangeEvent event) {
logger.info("1");
selectedValue = event.getNewValue().toString();
}
Values are added like
public void loadItems(){
selectItems.add(new SelectItem("1", "One"));
selectItems.add(new SelectItem("2", "Two"));
selectItems.add(new SelectItem("3", "Three"));
selectItems.add(new SelectItem("4", "Four"));
}
And method is called as follows
public List<SelectItem> getSelectItems() {
if (selectItems == null) {
loadItems;
}
return selectItems;
}