Custom Widget - attributes configuration

Hi, I would like to pass an integer as input to my custom widget in Mendix8 In the tutorial it only shows how to configure a string attribute: <property key="state" type="attribute"> <caption>State</caption> <description/> <attributeTypes> <attributeType name="String"/> </attributeTypes> </property> I tried to change the attributeType to Integer but this doesn’t seem handled. Someone knows how to configure an Integer attribute or other type or attributes? Also how do you set a field as optional?   Thank you, Seb
2 answers

Hi Sebastien,

Are you writing a pluggable widget (React) or custom widget (Dojo)

The widget XML should comply with the XSD found in the package

Types of attribute supported are:

<xs:simpleType name="attributeTypeNameType">
  <xs:restriction base="xs:string">
    <xs:enumeration value="AutoNumber" />
    <xs:enumeration value="Binary" />
    <xs:enumeration value="Boolean" />
    <xs:enumeration value="Currency" />
    <xs:enumeration value="DateTime" />
    <xs:enumeration value="Enum" />
    <xs:enumeration value="Float" />
    <xs:enumeration value="HashString" />
    <xs:enumeration value="Integer" />
    <xs:enumeration value="Long" />
    <xs:enumeration value="String" />
    <xs:enumeration value="Decimal" />

Please note the attribute types are capitalized

<property key="state" type="attribute">
		<attributeType name="Integer"/>


Cheers, Andries


Hi Sebastien,

I think that you will find your answers on this page: As it describes the use of XML in widget development. 

Hope this will help you.