Custom Widget - attributes configuration

0
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
asked
2 answers
2

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 https://www.npmjs.com/package/mendix

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" />
  </xs:restriction>
</xs:simpleType>

Please note the attribute types are capitalized

<property key="state" type="attribute">
	<caption>State</caption>
	<description/>
	<attributeTypes>
		<attributeType name="Integer"/>
	</attributeTypes>
</property>

 

Cheers, Andries

answered
0

Hi Sebastien,

I think that you will find your answers on this page: https://docs.mendix.com/howto7/widget-development/use-xml-widget. As it describes the use of XML in widget development. 

Hope this will help you.

Cheers,

Jeffrey

answered