是否可以在typeAhead功能中调用Dialog组件? 我想要做的是如果用户输入一个没有提出typeAhead功能的单词,那么屏幕上会出现一个对话框。 请在下面找到我的代码(我的对话框是自定义控件)
关心
Cumhur Ata
<?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 :(得分:2)
你可以劫持预先输入的结果,并使用这个片段调用你的对话框,如果它是空的:
https://openntf.org/XSnippets.nsf/snippet.xsp?id=typeahead-onstartoncomplete-event
答案 1 :(得分:0)
我现在手头没有Domino Designer,所以我不能尝试这个。所以这只是猜测:
我认为您不能使用标准的Edit Box控件的类型提前功能;相反,您可以使用控件的“onkeyup”事件自行编程,模仿前面的标准类型。我们的想法是,经典的预先输入操作作为可能条目列表的过滤器,就像在每个键击中触发的“getElementsByKey”方法一样。因此,对于每个事件,您都要检查编辑框中的内容,将其与列表进行比较,然后在弹出窗口中将过滤结果显示给用户(您可能希望在此处使用dojo工具提示)。
如果结果为null,则可以改为显示对话框。