1

I've got a <selectOneMenu>with a list of objects, the first one is null (to allow "no selection" option), the problem is that when the "no selection" option is chosen, the valueChangeListener set in the is not fired.

我希望这能够从它的内容中清除数据表:

1)1个对象,不为空,被选中->在2)“不选择”选项被选中,清空表格。

这是我的代码:

                <h:selectOneMenu id="flowSelectionFilter"
                    value="#{errorController.flowSelectionFilter}" onchange="submit()"
                    valueChangeListener="#{errorController.changeFlow}">
                    <f:selectItems
                        value="#{errorController.flowSelectionFilterValues}"
                        var="flowFilter" itemLabel="#{flowFilter}" />
                </h:selectOneMenu>

public String changeFlow(ValueChangeEvent event) throws Glossat2Exception {

    if (glossaryVersionSelectionFilter == null) {
        glossaryVersionSelectionFilter = new GlossaryVersionSelectionFilter(this.errorBean.getSelectedGlossaryVersion());
    }
    flowSelectionFilter = flowSelectionFilterMap.get(event.getNewValue());
    errorBean.setSelectedFlow(flowSelectionFilter.getFlowWithAction());
    return loadErrorsList(glossaryVersionSelectionFilter.getGlossaryVersion(), flowSelectionFilter.getFlowWithAction(), errorBean.getSelectedData());
}

the method is fired when any other object than null is selected.

感谢您的帮助

4

0 回答 0