Question

I need to write a comboBox which calls a backing bean method on change event & after processing this method, I need to show a popup. Complexity lies where I need to show popup oncomplete event of the valueChangeListener. But oncomplete event is not supported by rich:comboBox. I tried to write code as:

    <rich:comboBox value="#{myBean.myObj.name}" 
    defaultLabel="Please Select" status="defaultStatus"
    valueChangeListener="#{myBean.validateNewValue}"
    oncomplete="if(#{myBean.showPopup}) #{rich:component('popUpPanel')}.show(); return false;" >
        <f:selectItems value="#{myBean.nameList}" />
        <a4j:support event="onchange" ajaxSingle="true" reRender="errTable,popUpPanel" />
        <a4j:support event="oncomplete" ajaxSingle="true" reRender="errTable,popUpPanel" />
</rich:comboBox>

But as comboBox don't support oncomplete event, its not possible. Can anyone help me to find out what can be done in this case? Or Is there any workaround to add support for oncomplete event to comboBox?

Was it helpful?

Solution

The oncomplete attribute is located on <a4j:support>, not on the input component. Just move it to there and get rid of <a4j:support event="oncomplete"> which is never fired anyway.

<rich:comboBox value="#{myBean.myObj.name}" 
    defaultLabel="Please Select" status="defaultStatus"
    valueChangeListener="#{myBean.validateNewValue}">
    <f:selectItems value="#{myBean.nameList}" />
    <a4j:support event="onchange" ajaxSingle="true" reRender="errTable,popUpPanel"
        oncomplete="if(#{myBean.showPopup}) #{rich:component('popUpPanel')}.show();" />
</rich:comboBox>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top