According to the current documentation, you have already found the right function.
Maybe you have read, that the mx.ui.action function is depricated and can be removed by an update and not the mx.data.action?
Hi Haiji,
You can now use the action property in the xml (type = action). When using this, the user can choose what to do: open a page, call a microflow, nanoflow, etc.
In your code, you can do something like:
if (microflowProp && microflowProp.canExecute) {
microflowProp.execute();
}
Hope this helps!
Hi @Johan Munneke,
I Folow the guide doc to create a pluggable widget. but the action prop aways empty . could you please help have a look?
<propertyGroup caption="Events">
<property key="onChangeAction" type="action" required="false">
<caption>On change</caption>
<description/>
</property>
</propertyGroup>
export interface InputProps {
value: string;
onChangeAction?: ActionValue;
}
export class TextInput extends Component<InputProps> {
private readonly handleChange = this.onChange.bind(this);
render(): ReactNode {
return <input type="text"
onBlur={this.handleChange}
value={this.props.value} />;
}
private onChange(event: ChangeEvent<HTMLInputElement>) {
….
alert(JSON.stringify(this.props)); // HERE, It aways dispay {value:”xxx”}, have no prop of onChangeAction
if (this.props.onChangeAction) {
alert("XZXX"+event);
this.props.onChangeAction.execute();
}else{
alert("NO:"+event);
}
END