Access view from requireJS controller js

This thread was migrated from an old forum. It may contain information that are no longer valid. For further assistance, please post a new question or open a support ticket from the Customer Support portal.

Need help in this scenario, where controller cannot access view objects.

onPreApp init, we have one service call. On service callback we need to assign values to the form.

Pre-app init will not block the execution and startup form has already been shown.

Hi,

In order to achieve your requirement, please follow below steps.

1. In the service callback, use kony.mvc.Navigation API along with conditional flags and data, as shown below

var config = { "fromServiceCallBack" : true, "formassignvalue" : "success" }

new kony.mvc.Navigation("Form1").navigate(config);

2. In the onNavigate() of Form1, stop the navigation and set the values to Form1, as shown below,

onNavigate : function onNavigate(config){

if(config !== undefined && config.fromServiceCallBack !== undefined && config.fromServiceCallBack === true){

this.pauseNavigation();

this.view.Button0h6f40f9ddb934b.text = config.formassignvalue;

}

}

Note :

1. Please find attached 8.2 built sample project and .apk for your reference.

2. Hope your query has been answered, let me know if you need any other info regarding this query.

Regards,

This post is empty, no comment was left. Hopefully better content is forthcoming.

Please find missing apk