The WebClientUtils plugin is a plugin that is not part of the default distribution of Servoy, but is hosted on ServoyForge.
The plugin adds the following capabilities to the Servoy environment:
Allows to force inclusion of some of the JavaScript libraries Servoy ships with: Servoy by default conditionally includes them onto the Web Client markup only when they are needed. If custom clientside logic requires the library to be available, this can be done using the following code:
plugins.WebClientUtils.addJsReference(SERVOY_WEB_RESOURCES.JQUERY) |
For an overview of the version of each JavaScript library that is bundled with Servoy, check the Servoy stack info
For example to center the current webclient form with the WebClientUtils execute the following script in each form onRender:
var form_account_script = "var main_form = document.getElementById('form_" +currentcontroller.getName()+ "');" ; form_account_script += "if (main_form != null){" ; form_account_script += "main_form.style.width='940px';" ; form_account_script += "main_form.style.left='50%';" ; form_account_script += "main_form.style.top='0px';" ; form_account_script += "main_form.style.bottom='0px';" ; form_account_script += "main_form.style.position='absolute';" ; form_account_script += "main_form.style.marginLeft='-470px';" ; form_account_script += "}" ; plugins.WebClientUtils.executeClientSideJS(form_account_script); |
this example assuming your form is 940px wide.