1

I'm trying to get client side validation working with a Dojo Filtering Select, however it just does not work :-( Here is the code for the filtering select. Can anyone say what is wrong or what is missing here?

<xe:djFilteringSelect id="djFilteringSelect1">
<xe:this.dojoAttributes>
<xp:dojoAttribute name="required" value="true">
</xp:dojoAttribute>
<xp:dojoAttribute name="missingMessage" value="please add a value to this field!">
</xp:dojoAttribute>
</xe:this.dojoAttributes>
<xp:selectItem itemLabel=""></xp:selectItem>
<xp:selectItem itemLabel="Acai"></xp:selectItem>
 <xp:selectItem itemLabel="Apple"></xp:selectItem>
<xp:selectItem itemLabel="Apricot"></xp:selectItem>
<xp:selectItem itemLabel="Artichoke"></xp:selectItem>
<xp:selectItem itemLabel="Asparagus"></xp:selectItem>
<xp:selectItem itemLabel="Avocado"></xp:selectItem>
</xe:djFilteringSelect>
4

1 回答 1

2

如果您向 s 列表添加一个selectItem值,则该值是有效值

只需在您的代码中替换这一行

<xp:selectItem itemLabel=""></xp:selectItem>

<xe:this.defaultValue><![CDATA[""]]></xe:this.defaultValue>

如果在提交期间字段为空,那么您会收到预期的丢失消息。

于 2013-10-08T13:06:53.363 回答