简体   繁体   English

提前输入Call XPages对话框

[英]Call XPages Dialog in typeAhead

is it possible to call a Dialog component in typeAhead functionality? 是否可以在typeAhead功能中调用Dialog组件? What i want to do is If the user enter a word which does not come up with typeAhead function then a dialog should appear on the screen. 我想做的是,如果用户输入的单词不带typeAhead函数,那么屏幕上应该会出现一个对话框。 Please find my code below (my dialog is in custom control) 请在下面找到我的代码(我的对话框在自定义控件中)

Regards 问候
Cumhur Ata 库姆·阿塔(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>

You can hijack the result of the typeahead and call your dialog if it's empty by using this snippet: 您可以劫持预先输入的结果,并使用以下代码段调用对话框(如果该对话框为空):

https://openntf.org/XSnippets.nsf/snippet.xsp?id=typeahead-onstartoncomplete-event https://openntf.org/XSnippets.nsf/snippet.xsp?id=typeahead-onstartoncomplete-event

I don't have Domino Designer at hand right now so I can't try this out. 我现在没有Domino Designer,因此无法尝试。 So this is just guessing: 所以这只是猜测:

I don't think that you can use the standard Edit Box control's type ahead feature for something like that; 我不认为您可以使用标准的Edit Box控件的type type前面功能; instead you could program this yourself using the control's "onkeyup" event, mimicking the standard type ahead. 相反,您可以使用控件的“ onkeyup”事件自己编写程序,模仿前面的标准类型。 the idea is that a classic type-ahead operates as a filter to a list of possible entries, just like a "getElementsByKey" method that is fired upon each key stroke. 这个想法是,经典的预先输入可作为可能条目列表的过滤器,就像在每次击键时触发的“ getElementsByKey”方法一样。 So with every event you check what's in the Edit Box so far, compare it to your list, then display the filtered result to the user in a pop-up (you may want to use a dojo tooltip here). 因此,对于每个事件,您都需要检查到目前为止“编辑框”中的内容,将其与列表进行比较,然后在弹出窗口中向用户显示过滤后的结果(您可能要在此处使用dojo工具提示)。

If the result is null you can bring up your dialog instead. 如果结果为空,则可以调出对话框。

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

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