2016-03-28 56 views
0

是否可以在typeAhead功能中调用Dialog组件? 我想要做的是如果用户输入一个没有出现typeAhead函数的单词,那么屏幕上应该会出现一个对话框。 请在下面找到我的代码(我的对话是在自定义控件)类型前调用XPages对话框前

问候
Cumhur阿拉木图

<?xml version="1.0" encoding="UTF-8"?> 
<xp:view xmlns:xp="http://www.ibm.com/xsp/core" xmlns:xe="http://www.ibm.com/xsp/coreex"> 
<xe:dialog id="dialogConfirmation"> 
<div class="modal-body"> 
       <p>You have entered a word which is not in the list</p> 
       <p class="text-warning">Please add/or cancel<small> </small></p> 
      </div> 
    <xe:dialogButtonBar id="dialogButtonBar1"> 
     <xp:button value="Hayır" id="btnConfirmYes"> 
      <xp:eventHandler event="onclick" submit="false"> 
       <xp:this.script><![CDATA[XSP.closeDialog('#{id:dialogConfirmation}')]]></xp:this.script> 
      </xp:eventHandler></xp:button> 
     <xp:button value="Evet" id="btnConfirmNo" styleClass="btn-primary"> 
      <xp:eventHandler event="onclick" submit="true" 
       refreshMode="complete"> 
       <xp:this.action><![CDATA[#{javascript:openNewFrm(sessionScope.extDbPath,sessionScope.expDbPage)}]]></xp:this.action> 
      </xp:eventHandler> 
     </xp:button> 
    </xe:dialogButtonBar> 
    <xe:this.title><![CDATA[#{javascript:var c = "Warning";return c;}]]></xe:this.title></xe:dialog></xp:view> 

回答

0

我没有手头有Domino Designer中所以我现在不能尝试了这一点。所以这只是猜测:

我不认为你可以使用标准的编辑框控件的类型提前类型的功能;相反,您可以使用控件的“onkeyup”事件来编程,模拟标准类型。这个想法是,一个经典的type-ahead可以作为一个可能条目列表的过滤器,就像每次击键时触发的“getElementsByKey”方法一样。因此,对于每个事件,您都会检查编辑框中到目前为止的内容,将其与您的列表进行比较,然后在弹出窗口中向用户显示过滤结果(您可能希望在此处使用dojo工具提示)。

如果结果为空,则可以调出对话框。