Reputation: 447
I need to customize a screen where the user can inform the worklight server ip in client-side. I can change the url connection dynamically? I know that pressing the menu button in android, there is the option of informing the url, but i want custom screen.
Upvotes: 3
Views: 1073
Reputation: 11
if you dig into the worklight.js file there is a function "setWLUrl(url)" that can be use to chnange the serevr URL. call it like this and its done
setWLUrl("http://"+yourServerIP+":PORT");
its kind a hack but i think it should not have anny issue since its a function within there api.
Good Luck
Upvotes: 0
Reputation: 13
For Worklight v6.1, you can set below properties dynamically:
WL.StaticAppProps.APP_SERVICES_URL = your URL + WL.StaticAppProps.POSTFIX_APP_SERVICES_URL;
WL.StaticAppProps.WORKLIGHT_ROOT_URL = your URL + WL.StaticAppProps.POSTFIX_WORKLIGHT_ROOT_URL;
WL.StaticAppProps.WORKLIGHT_BASE_URL = your URL;
Upvotes: 0
Reputation: 44516
Technically speaking it is possible to change the Worklight Server URL that the application connects to, but things can and likely will go wrong and it is absolutely not supported by IBM Worklight.
As for creating some UI for it, that's on you.
See this answer by Anton: Re-route/Divert some WL.Client Adapter Invocation traffic to WL Server through different URL (for PCI payment and security requirements)?
Also see the following questions:
Upvotes: 1