@@ -19,13 +19,14 @@ define([
1919 _timeData : null ,
2020 _replaceAttr : null ,
2121 attrList : null ,
22+ onclicknf : { } , // Nanoflows are not strings, so need to make sure its always an object
2223
2324 postCreate : function ( ) {
2425 logger . debug ( this . id + ".postCreate" ) ;
2526
2627 this . _timeData = languagePack ;
2728
28- if ( this . onclickmf ) {
29+ if ( this . onclickmf || this . onclicknf . nanoflow ) {
2930 this . _setupEvents ( ) ;
3031 }
3132
@@ -43,7 +44,7 @@ define([
4344 _setupEvents : function ( ) {
4445 logger . debug ( this . id + "._setupEvents" ) ;
4546 on ( this . domNode , "click" , lang . hitch ( this , function ( e ) {
46- this . execmf ( ) ;
47+ this . execOnclick ( ) ;
4748 if ( this . stopClickPropagation ) {
4849 e . stopPropagation ( ) ;
4950 }
@@ -266,8 +267,8 @@ define([
266267 }
267268 } ,
268269
269- execmf : function ( ) {
270- logger . debug ( this . id + ".execmf " ) ;
270+ execOnclick : function ( ) {
271+ logger . debug ( this . id + ".execOnclick " ) ;
271272 if ( ! this . _contextObj ) {
272273 return ;
273274 }
@@ -294,6 +295,16 @@ define([
294295
295296 mx . data . action ( mfObject , this ) ;
296297 }
298+ if ( this . onclicknf . nanoflow ) {
299+ mx . data . callNanoflow ( {
300+ nanoflow : this . onclicknf ,
301+ origin : this . mxform ,
302+ context : this . mxcontext ,
303+ error : function ( error ) {
304+ logger . error ( this . id + ": An error ocurred while executing nanflow: " , error ) ;
305+ }
306+ } ) ;
307+ }
297308 } ,
298309
299310 _resetSubscriptions : function ( ) {
0 commit comments