XPages – 禁用Dojo组合框的客户端验证

前端之家收集整理的这篇文章主要介绍了XPages – 禁用Dojo组合框的客户端验证前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在尝试禁用Dojo组合框的客户端验证失败.我添加了一个dojo属性required”并将其设置为false但这仍然无效.我确实希望启用服务器端验证,这就是我设置required =“true”的原因.任何人都可以看到需要对以下代码进行哪些更改?

<xe:djComboBox id="djComboBox1" required="true" disableClientSideValidation="true">
<xe:this.dojoAttributes>
<xp:dojoAttribute name="required" value="false">
</xp:dojoAttribute>
</xe:this.dojoAttributes>
<xp:selectItem itemLabel="" />
<xp:selectItem itemLabel="Apples" />
<xp:selectItem itemLabel="Oranges" />
<xp:selectItem itemLabel="Pears" />
<xp:selectItem itemLabel="Bananas" />
<xp:selectItem itemLabel="Plums" />
</xe:djComboBox>

解决方法

尝试使用始终返回true的方法覆盖组合框的客户端验证公式:

<xe:djComboBox
    id="djComboBox1"
    required="true"
    validatorExt="return true;">
    <xp:selectItem itemLabel="" />
    <xp:selectItem itemLabel="Apples" />
    <xp:selectItem itemLabel="Oranges" />
    <xp:selectItem itemLabel="Pears" />
    <xp:selectItem itemLabel="Bananas" />
    <xp:selectItem itemLabel="Plums" />
</xe:djComboBox>

猜你在找的Dojo相关文章