Hi,
i see indeed as i have suspected you change back the text value to "Save" within the same code stack.
I have mentioned in my previous message
Please note, if within the same call stack you reset the text to "Save" you may not be able to see the text changing.
Because of timing and perfomance optimization Servoy doesn't push immediately to the UI any single change of an element state.
An update of the state (and therefore of the UI) is forced at the end of the code stack or when executing a method which requires to operate with the UI.
In simple words: you have have to execute a method which does a round-trip to the UI so a state update is pushed.
- Code: Select all
saveButton.text = i18n.getI18NMessage("Message.Saving");
saveButton.enabled = false;
saveButton.requestFocus();
// this method is a type of method which does a round-trip to the UI
plugins.ngclientutils.getUserAgent();
// saveSettings(event); //do the actual saving
application.sleep(2000);
saveButton.text = i18n.getI18NMessage("Action.Save");
saveButton.enabled = true;
return true
Nevertheless i suggest you use the svyBlockUI service instead :
https://github.com/Servoy/svyBlockUI/wikiThe svyBlockUI it fits perfectly these situations where you want to block the UI and inform the user that their request is being elaborated.
You can install this service via the Servoy Web Package Manager (right click your solution: "Download/Install via Web Package Manager) in the NG Services section.
Regards,
Paolo