无法删除在xPages中djFilteringSelect dojo控件中输入的值 [英] Can't remove the value entered in the djFilteringSelect dojo control in xPages

查看:259
本文介绍了无法删除在xPages中djFilteringSelect dojo控件中输入的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用djFilteringSelect控件来显示下拉列表中的值,因为用户键入一个值。
查找和类型头正常工作。用户键入一个字母并且下拉列表允许用户选择一个值,然后显示在下拉字段中。



如果用户现在决定删除首先选择的值所以组合框是空的,离开字段,然后列表中的第一个值现在自动填写。



这样做的结果是,如果用户已经添加一个值没有办法删除该值并离开盒子emtpy。



我正在对控件和dojo属性使用required = false,但似乎不帮助。还有一些其他djFilteringSelect属性我已经尝试像自动完成和修剪,但它不工作



这里是代码

 < xe:djFilteringSelect id =testtype =selectstore =jsondatasearchAttr =datarequired =falselabelType = htmlinvalidMessage =无效> 
< xe:this.dojoAttributes>
< xp:dojoAttribute name =requiredvalue =false>< / xp:dojoAttribute>
< / xe:this.dojoAttributes>
< / xe:djFilteringSelect>

最初,该字段不是必需的,但如果用户输入了一个值,则是必需的。 p>

我的问题是如果有办法阻止djFilteringSelect控件总是填充字段,如果我以前添加了一个值

解决方案

我做得很好。现在我没有一个工作示例来显示(因为我已经转到自举程序了,而且必须通过手动添加select2控件来代码选择),但是这样做应该是这样的...



我在我的选择的顶部添加一个空值 - 这似乎工作,无论我是否使用组合框,djCombobox或组合框与select2从引导。我的标记通常看起来像:

 < xp:comboBox id =inputLocationSelectorvalue =#{User.catchListType} disableClientSideValidation = 真 > 
< xp:selectItem itemLabel =(none)itemValue =>< / xp:selectItem>
< xp:selectItems>
< xp:this.value><![CDATA [$ {Configuration.meta.listLocationTypeOptions}]]>< / xp:this.value>
< / xp:selectItems>
< / xp:comboBox>

然后你可以为not-指定(无),全部选择值取决于您的需要。



验证是一个不同的事情,所以只需指定required = false不会给你空的值。

/ John


I am using the djFilteringSelect control to show values in a dropdown as user type a value. The lookup and typehead is working fine. The user type a letter and the dropdown allow the user to select a value which is then displayed in the dropdown field.

If the user now decide to remove the value first selected so that the combobox is empty and leave the field, then the first value in the list is now automatically filled in.

The consequence of this is that if the user have added a value there is no way to remove the value and leave the box emtpy.

I am using required=false for both the control and the dojo attribute but it does not seem to help. There are also a few other djFilteringSelect attributes I have tried like "Autocomplete" and "trim" but it does not work

Here is the code

<xe:djFilteringSelect id="test" type="select" store="jsondata" searchAttr="data" required="false" labelType="html" invalidMessage="Not valid">
        <xe:this.dojoAttributes>
            <xp:dojoAttribute name="required" value="false"></xp:dojoAttribute>
        </xe:this.dojoAttributes>
</xe:djFilteringSelect>

Initally the field is not required, but if the user have entered a value it is required.

My question is if there a way to prevent the djFilteringSelect control to always populate the field if I have previously added a value

解决方案

I do this quite a lot. Right now I don't have a working sample to show you (since I moved to bootstrap - and have to code the selects by manually adding select2 controls) but something like this should do it...

I add an "empty" value at the top of my select - and that seems to work no matter whether I am using a combobox, djCombobox or combobox with select2 from bootstrap. My markup typically looks like:

<xp:comboBox id="inputLocationSelector" value="#{User.catchListType}" disableClientSideValidation="true">
    <xp:selectItem itemLabel="(none)" itemValue=""></xp:selectItem>
    <xp:selectItems>
        <xp:this.value><![CDATA[${Configuration.meta.listLocationTypeOptions}]]></xp:this.value>
    </xp:selectItems>
</xp:comboBox>

Then you could specify "(none)", "All" or " " for the "not-selected" value depending on your needs.

Validation is a different thing so just specifying "required=false" does not give you the "empty" value.

/John

这篇关于无法删除在xPages中djFilteringSelect dojo控件中输入的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆