Disclaimer - I am newbie to richfaces as I used to work on .net platform earlier :)
I am trying to change the theme of the RichFaces application with materialize css. I have a simple h:selectOneMenu as below
<h:selectOneMenu value="#{testBean.presetDate}" valueChangeListener="#{testBean.resetValues}" id="presetDate">
<f:selectItem itemValue="-1" itemDisabled="true" itemLabel="Select days" />
<f:selectItems value="#{testBean.listOfPresetDates}" />
<a4j:support event="onchange" ajaxSingle="true">
</a4j:support>
</h:selectOneMenu>
and my resetValues method inside testBean.java is as follows:
public void resetValues(ValueChangeEvent valueChangeEvent) {
//some processing here
}
and I have been initialising this selecOneMenu with materialize css multi_select() plugin as below:
$('select').material_select();
But whatever I do, the valueChangeListner doesn't trigger at all. I mean, it never calls the method in server. I also tried putting that method as actionListener in a4j:support and changing parameter of server method as ActionEvent, but even that doesn't help. Anything else I have to configure along with this?
Note: Earlier design had rich:combobox instead of selectOneMenu which was working fine with changeListener, but the plugin will not be able to convert this to required material select since, the above will not render select element, rather it renders table and inputs in DOM.
EDIT
Forgot to mention one thing. We are loading this page through ajax request as below:
<a4j:form id="pageForm" rendered="#{prevBean.selectedPage == 'bth'}">
<a4j:include viewId="/newPage.jsp" id="newPage" rendered="#{prevBean.selectedPage == 'bth'}" />
<script type="text/javascript">
jQuery(document).ready(function() {
initSelect_DatePicker();
});
</script>
</a4j:form>
This newPage.jsp contains above control. Will this be a cause for the above problem?