Launching UI5 apps with additional URL parameters in WebIDE
I recently came across the issue of testing a UI5 app in the WebIDE that required URL parameters on launch and although this could be achieved easily on a local server setup, when deployed onto HCP the WebIDE seemed to provide few options for testing.
The WebIDE provides a nice size adjustable Frame layout to test code changed however the URL provided is run from a HCP server and so contains non standard URL parameters.
On a recent project I was required to launch my app with URL parameters after the index.html with a hash followed by multiple parameters.
e.g. https://account.hanaondemand.com/myapp/index.html/#/urlparam1/one/urlparam2/two
This can be particularly useful when running apps within environments that pass information into your UI5 app on launch, e.g. custom C4C apps. Or even to test routing mechanisms within HCP without having to commit your untested code to HCP with a version number or push it to HCP with a git tag for versioning.
As it happens, looking closer at the WebIDE settings you can customise how it runs web applications for testing purposes.
Under Run » Run Configurations » New Run Configuration you can specify how you would like to run your app.
Here you can specify settings such as which version of the SAPUI5 SDK you would like to load. You can even provide standard URL parameters which are in turn translated into ASCII characters as standard in your web browser.
Un-ticking the ‘Open with frame’ tick box will force WebIDE to load your app in full screen mode when the button is pressed, you may have to select the ‘Run’ menu and click on your test configuration.
Now that your app has opened you can manipulate the browsers URL and test your code without having to deploy to HCP.
It seems to me that your post would fit better in the SAPUI5 Developer Center which is also the home for the SAP Web IDE. If you agree, we can easily move it there.
Also, could you please replace the screenshots with higher resolution ones as even after clicking on them they still open the same size and are hardly readable.
Thanks,
--Vlado (Moderator)
Moved to SAPUI5 Developer Center as Michael Appleby (SAPUI5 Developer Center moderator) also agreed.
Thanks Vladimir!
Hi Christoper,
Need more information about passing parameters within url. What is the use of passing parameters with url.
If I pass parameters within url, should I able to use it in my UI5 app which was developed using WebIDE. How could I use it in my UI5 app?
Please suggest me.
Thanks and regards,
Karthik S
Hi Christopher,
How did you acheive passing parameters to ui5 app on launching. I am having a similar requirement and unable to proceed further. Please help.
Thanks and Regards
Pooja Balakrishnan