Using dojoType on mendix widgets?

4
Following up the question on building widgets with dojo. When you create a widget based on dojo it is possible to set a dojoType in the template. This allows for quick reuse of existing widgets. Do existing mendix widgets also have a dojoType or maby a mendixType that makes them accessable in a template? A workaround would be to create a dojo widget that contains the mendix widget however if possible i would like to avoid creating a wrapper for mendix widgets.
asked
1 answers
5

Mendix widgets can be used in the same way as Dojo widgets. Actually, Mendix widgets are Dojo widgets and so they can be instantiated via markup with a dojoType. MxButton for example has dojoType "mendix.widget.MxButton", and can be instantiated as follows:

<div dojoType="mendix.widget.MxButton" title="Title" ... ></div>

To see how existing Mendix widgets are used, check the exported forms (mxf-files) in your deployment/web/forms directory.

answered