简体   繁体   English

XPages对话框堆叠

[英]XPages Dialog boxes stacking

I got the problem, that my dialog boxes are stacking each time I click the button that opens the dialog. 我遇到的问题是,每次单击打开对话框的按钮时,对话框都会堆叠在一起。 So if I've clicked three times I get this: 因此,如果我单击了三下,我会得到以下信息:

在此处输入图片说明

I couldn't find out how to prevent this. 我找不到解决办法。 No matter which button I click (OK does a partial refresh | Abbrechen (Cancel) does a full update) I get another box each time I click the button. 不管我单击哪个按钮(“确定”都会进行部分刷新| Abbrechen(“取消””会进行完整更新))每次单击该按钮时,都会得到另一个框。

Code of the button that opens the dialog: 打开对话框的按钮的代码:

<xp:button value="Plan meeting" id="buttonPlanMeeting">
  <xp:eventHandler event="onclick" submit="true" refreshMode="complete">
    <xp:this.action><![CDATA[#{javascript:try {
      var c = getComponent("dPlanMeeting")
      c.show();
    } catch(e) {
      dBar.error(location + e);
    }}]]></xp:this.action>
  </xp:eventHandler>
</xp:button>

Code for the complete dialog box: 完整对话框的代码:

<xe:dialog id="dPlanMeeting" title="Plan meeting" keepComponents="true">
  <xp:panel>
    <xp:text escape="true" id="MBPlanMeeting">
      <xp:this.value><![CDATA[#{javascript:specialstrings.getString("ccEsgDocWflContentEditInfos.dPlanMeeting.MBPlanMeeting")}]]></xp:this.value>
    </xp:text>
  </xp:panel>
  <xe:dialogButtonBar>
    <xp:button value="Ok" id="buttonDelegateOk" styleClass="lotusFormButton">
      <xp:eventHandler event="onclick" submit="true" refreshMode="complete">
        <xp:this.action><![CDATA[#{javascript:try {
          //will create a meeting for every day the visit is registered
          var wfDoc:NotesDocument = docApplication.getDocument(true);
          specialMeetingCreate(wfDoc);

          var c = getComponent("dPlanMeeting");
          c.hide();

          var c = getComponent("dMeetingCreated")
          c.show();
        } catch (e) {
          dBar.error(location + e);
        }
       }]]></xp:this.action>
      </xp:eventHandler>
    </xp:button>
    <xp:button value="Cancel" id="buttonDelegateCancel" styleClass="lotusFormButton">
      <xp:eventHandler event="onclick" submit="true" refreshMode="complete">
        <xp:this.action><![CDATA[#{javascript:try {
          var c = getComponent("dPlanMeeting");
          c.hide();
        } catch (e) {
          dBar.error(location + e);
        }
      }]]></xp:this.action>
    </xp:eventHandler></xp:button>
  </xe:dialogButtonBar>
</xe:dialog>

Does this have anything to do with keepComponents? 这与keepComponents有关系吗? I've tried true and false, but the effect stays the same. 我已经尝试过对与错,但是效果保持不变。

Any idea? 任何想法?

Ok it seems that the solution was just to set "keepComponents = false". 好的,似乎解决方案只是设置“ keepComponents = false”。 I've tried that before, but now it'S working. 我曾经尝试过,但是现在可以了。 I get the dialog box only once no matter how often I click the button 无论我单击按钮的频率如何,都只会获得一次对话框

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

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