get output from the custom widget

0
hi team,  how i can get the output from the custom mendx widget . suppose in my mendix widget i give the number and i want to get the square root of that number and i want to show the output in show message activity.   thanks
asked
2 answers
1

First you need to add these two property in your xml file

<property key="myInteger" type="integer" defaultValue="1000">
	<caption>My integer</caption>
	<description>My integer setting</description>
</property>
<property key="buttonAction" type="action">
	<caption>On click</caption>
	<description>Action to be performed when button is clicked</description>
</property>

 

In mendix add this widget inside a dataview.  and select attribute which you want to pass.

 

//Get attribute value

let number = parseInt(props.myInteger.displayValue);

//For update mendix attribute 

props.myInteger.setTextValue(number*number);



//Call a microflow/nanoflow

if(buttonAction && buttonAction.canExecute){
    buttonAction.execute();
}

 

In microflow you will get updated object .

 

Hope this will help you.

answered
0

By custom widget, you mean custom pluggable widget?

If so, you can call a microflow and pass your number as the output. That microflow can then show a message with the parameter.

 

This forum question might help:

https://community.mendix.com/link/space/widgets/questions/99506

 

answered