| 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. |
Hi
We have a requirement to map i18n values from service to the MVC form widgets and alert messages. We tried calling the service in postappinit but getting 'Not authorised' error. This does not need an identity service to be mapped, still getting this error. Is this because of MF console not initialized?
When we try to call service from the onClick event of a button, it gets called and we get the response. This is what we have in code after response received in the onclick event
if(result !== null && result !== undefined){
var inputtable = {
"LBL_USERNAME": result["data"].key1,
"LBL_PWD": result["data"].key2
};
kony.i18n.setResourceBundle(inputtable,"en_US");
kony.print("i18 "+kony.i18n.getLocalizedString("LBL_PWD")); // prints the string
kony.i18n.setCurrentLocaleAsync("en_US",
function successCBi18n(){
kony.print("successCBi18n"); // printing this
}, function failureCBi18n(){
kony.print("failureCBi18n"); });
}
But the widget text is not refreshed immediately. If we close the app and open again it is refreshed with the new language values. But why is it not refreshing immediately?
We have seen in kony 6.5, if we navigate to another form, set locales there and destroy all other forms in background and navigate to the landing page, this used to refresh the data.
So we also tried the following but did not work
- navigating to another form ->destroy this current form -> set locale in navigated form by calling service for i18n -> navigate to prev form.
- navigating to another form -> set locale here by calling service for i18n ->destroy prevForm-> navigate to prev form.
we used
var ntf = new kony.application.previousForm();
ntf.destroy(); and then used kony.mvc.navigate() but we got 605 error in destroy();
Being in MVC, we could not get control on the other forms from a particular controller/action. How do we achieve the requirement? pl suggest
Thank you