开发者

InfoPath form created from XSD: Dropdown empty value "Select"

I have created an XSD and then I created an InfoPath form (2010) based on this XSD. All fine, but I have a little problem with enumerations. To create enumerations I have created a simple type, e.g.:

<xs:simpleType 开发者_JAVA技巧name="weekday">
    <xs:restriction base="xs:string">
      <xs:enumeration value="MA"/>
      <xs:enumeration value="DI"/>
      <xs:enumeration value="WO"/>
      <xs:enumeration value="DO"/>
      <xs:enumeration value="VR"/>
      <xs:enumeration value="ZA"/>
      <xs:enumeration value="ZO"/>
    </xs:restriction>
  </xs:simpleType>

When I create a dropdown in InfoPath, it automatically creates a dropdown with these values and one empty value with display name "Select..." However, I want that "Select..." to be the Dutch translation, namely "Selecteer...". When I change the choice value, I get the error "The specified value is not valid" (even when I change nothing)


I've had the same problem and could find no easy fix, without editing the original xsd.

What didn't work for me:

  • Modifying the "Select..." option via the Properties window
  • Trying to trick InfoPath by swapping the Binding source to a different (nullable) field, then changing the "Select..." text, then swapping the binding back (InfoPath reverted the text back to its original value!)

The least-worst workaround I could find was:

  • Add a blank enumeration to your Weekday xsd type: <xs:enumeration value=""/>
  • In the Data tab, Refresh Fields to leverage the new xsd
  • Then add a new Validation rule on your drop-down to ensure that a Weekday value is selected; i.e. Condition: "is blank", ScreenTip: "Cannot be blank".

In your drop-down, you can now modify the "Select..." display text to your heart's content, while retaining weekday as a mandatory field.

If you really want to, you can then revert the xsd back to its original format, refresh fields, and delete the rule.... the drop-down will still retain your custom default text.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜