简体   繁体   English

JSF- <p:selectOneMenu > -未显示相同值的对话

[英]JSF - <p:selectOneMenu > - Dialogue not shown for the same value

My question is simialr to selectOneMenu ajax events 我的问题是类似selectOneMenu Ajax事件


My code: 我的代码:

<p:selectOneMenu style="width:150px" editable="true"
                                            value="#{Bean.xxx}">
                                            <p:ajax event="change"
                                                listener="#{Bean.showSearchPopup}"
                                                async="false" update=":actualexppop" />

                                        </p:selectOneMenu>


My Backing Bean code : 我的Backing Bean代码:

     public void showPrismsiSearchPopup(final AjaxBehaviorEvent event) {
                if (xxx!= null && xxx.length() > 0) {
    //Going to DB for getting some list value to show in the Datatable which is located in the pop up.
    }
            RequestContext context = RequestContext.getCurrentInstance();
//Dialogue is getting called below              
context.execute("xxxdlg.show()");

            }


My problem is 我的问题是

Say, If I provide the value of the editable p:selectonemenu as "test" and then I am selecting the drop down to show the dialogue which is called from the backing bean.The dialogue is getting displayed for the first time for the value "test" and if I close the dialogue and select the p:selectonemenu with the same value "test" the dialogue is not shown. 说,如果我将可编辑的p:selectonemenu的值提供为“ test”,然后选择下拉菜单以显示从后备bean调用的对话框。该对话框首次显示为值“测试”,如果我关闭对话框并选择具有“测试”相同值的p:selectone菜单,则不会显示该对话框。

Simply ,the dialogue is shown only for the first time, not for the second time with the same value provided in. 简而言之,对话框仅第一次显示,而第二次显示的对话框中没有提供相同的值。

If I keep changing the values the Dialogue is opening correctly. 如果我不断更改值,那么对话将正确打开。

How to make the dialogue to shown each time though the seletmenu has same value ? 尽管seletmenu具有相同的价值,如何使对话框每次显示?

If you select the same option then change event is not called. 如果选择相同的选项,则不会调用更改事件。 You can try to unset value="#{Bean.xxx}" so that next time you select "test" again change event is propagated. 您可以尝试取消设置value =“#{Bean.xxx}”,以便下次选择“测试”时,传播更改事件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM