on 2020 Jun 02 4:48 PM
good morning,
How can I get the value of a variable from my js code in the backend, in the Kiosk Mode ( Quick service)?
Request clarification before answering.
Dear xsalgadog,
you need to send the input value into the eventbus through the plugin event channel.
this.pluginService.backendPluginEvent('MY_PLUGIN_EVENT', {
'myData': inputModel.getValue()
});In your plugin (java) backend you need to implement a listener:
BroadcasterHolder.INSTANCE.addEventChannelListener(new UIEventChannelListener() {
@Override
public void handleEvent(String eventId, JSONObject payload) {
if(StringUtils.equals(eventId, "MY_PLUGIN_EVENT")) {
System.out.println(payload.getString("myData"));
}
}
}hth
Robert
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thank so much!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear xsalgadog ,
you may push an plugin event into the eventbus and implement a handler in your plugin backend.
as an example.
If this helped please kindly select my answer as the correct one as it may help other.
Regards
Robert
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.