add MicroFlow to widget

1
application : Simple custom widget to get the name on start up page. This is i will do with custom widget using a microflow. The code is standing below. The microflow return a String. tutorial xml <?xml version="1.0" encoding="UTF-8"?> <widget id="wo.wo" needsentitycontext="true" xmlns="http://www.mendix.com/widget/1.0/"> <name &gt;get="" data="" workflow<="" name="" &gt;="" <description="">Get data workflow</description> <icon> </icon> <properties> <property key="executeMicroflow" type="microflow" > <caption>Execute microflow</caption> <category>Widget</category> <description>This requires a microflow.</description> <returnType type="String"></returnType> </property> </properties> </widget> Javascript dojo.provide("wo.wo"); mendix.widget.declare('wo.wo',{ addons :null, val : '', inputargs : { }, postCreate : function() { this.actRendered(); }, getStr : function(val) { this.domNode.innerHTML = val.toString(); }, _getNews : function() { mx.processor.xasAction( { error : function() { logger.error(this.id + "nw" + "error: XAS error executing microflow"); }, actionname : this.executeMicroflow, guids : [this.dataObject.getGUID()], callback : dojo.hitch(this, this.processOutput) }); }, processOutput : function(output) { logger.debug(this.id + "th" + ".processOutput"); processedOutput = dojo.fromJson(output.xhr.responseText); this.val = (processedOutput); }, unititialize : function () { } }); But the data is not getting into the dataview , can some give me a example or make the code work.
asked
6 answers
1

It is not getting in to the dataview because you do not display the data anywhere, you just store it somewhere in the memory. You can extend processOutput with:

this.domNode.innerHTML = this.val;

logger is defined in the client. You can use index-console.html to get the output, or use console.log() instead, (but do not forget to remove them after debugging).

answered
0

hmm its still doesn't show any data

answered
0

Could we make a example for me.

answered
0

The problem is that dataObject is not filled en don't create it.

answered
0

problem solved by using apply Context

Extra function:


applyContext : function(context, callback)
{
        if (context && context.getTrackID()) 
        {
           this.contextobject = [context.getTrackID()];
         }
        callback && callback();
    },

and change guid : [dataobject.getGUID], --> guid : this.contextobject;

Hopefully i can help some with it.

answered
-1

A other question as well, Where can i find where the logger.error

answered