Quantcast
Channel: Mendix Forum Questions
Viewing all articles
Browse latest Browse all 83234

Custom widget data to Microflow - Error - Invalid JSONRequest: JSONObject["actionname"] not a string

$
0
0

Hi

Can someone help? This is a simple test widget to send the ID to Mendix microflow. It is giving an error

Error - Invalid JSONRequest: JSONObject["actionname"] not a string

Execute microflow call event handler

this.connect(this.saveHotspotNode, "click", function (e) {
                // Only on mobile stop event bubbling!
                this._stopBubblingEventOnMobile(e);

                // If a microflow has been set execute the microflow on a click.
                if (this.mfToExecute !== "") {
                    this._execMf(this.mfToExecute, this._contextObj.getGuid());
                    //this._execMf(this.mfToExecute, this._contextObj.jsonData.attributes.HotspotResult.value);
                }
            });

Execute function

_execMf: function (mf, guid, cb) {
            logger.debug(this.id + "._execMf");

            var _params = {
                actionname: mf,
                applyto: "selection",
                guids: [guid]
            };

            var mfAction = {
                params: _params,
                callback: lang.hitch(this, function (objs) {
                    if (cb && typeof cb === "function") {
                        cb(objs);
                    }
                }),
                error: function (error) {
                    console.debug(error.description);
                }
            };


            if (mf && guid) {

                mx.ui.action(mfAction, this);


            }
        },

 

Full error

org.json.JSONException: JSONObject["actionname"] not a string.
	at org.json.JSONObject.getString(JSONObject.java:684)
	at com.mendix.webui.actions.client.ExecuteAction.execute(ExecuteAction.java:65)
	at com.mendix.webui.requesthandling.ClientRequestHandler$$anonfun$handleRequest$1.apply$mcV$sp(ClientRequestHandler.scala:311)
	at com.mendix.webui.requesthandling.ClientRequestHandler$$anonfun$handleRequest$1.apply(ClientRequestHandler.scala:301)
	at com.mendix.webui.requesthandling.ClientRequestHandler$$anonfun$handleRequest$1.apply(ClientRequestHandler.scala:301)
	at com.mendix.core.session.Worker$$anonfun$receive$3$$anonfun$2$$anon$1.execute(ActionDispatching.scala:143)
	at com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:36)
	at com.mendix.core.session.Worker$$anonfun$receive$3$$anonfun$2.apply(ActionDispatching.scala:145)
	at scala.util.Try$.apply(Try.scala:192)
	at com.mendix.core.session.Worker$$anonfun$receive$3.applyOrElse(ActionDispatching.scala:139)
	at akka.actor.Actor$class.aroundReceive(Actor.scala:465)
	at com.mendix.core.session.Worker.aroundReceive(ActionDispatching.scala:135)
	at akka.actor.ActorCell.receiveMessage(ActorCell.scala:516)
	at akka.actor.ActorCell.invoke(ActorCell.scala:487)
	at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:238)
	at akka.dispatch.Mailbox.run(Mailbox.scala:220)
	at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:393)
	at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
	at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
	at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
	at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)

My widget

Domain Model:

Microflow:

Questions:

1. What's wrong with the code to fix error 'Invalid JSONRequest: JSONObject["actionname"] not a string'

2. Can I also ask that i have an array list which i want to send back to microflow as string. what is the best way to get string and send it back. Is there any string length limit? I am thinking to use dojo/json.stringify() function to get string.

 

Thanks for the help in advance

 

 


Viewing all articles
Browse latest Browse all 83234

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>