WebIDE “SAPUI5 Application Project” Template not working – Solution
Hi,
As a big fan of the SAP HANA Cloud Platform WebIDE I use the SAPUI5 templates to start my projects. Most of the time this is based on OData services and I use the full wizard to gerenate my app. In some cases it happens that I cannot use the OData service to generate your SAPUI5. The OData services is not finished ,they are still working on the backend logic or for some other reason I just have to start without a service.
Thanks to all the templates of the SAP WebIDE I don’t have to start from scratch. There is a template “SAPUI5 Application Project” which gererates a basic setup to start with SAPUI5.
I used this template to have a quick start 🙂 It immediately generated a full project like in the next picture. Just to test if everything was working fine, I’ve added a label in the main view with a small dummy text.
I just added a label between the content tags:
Just to see if this already would work, I did a quick test of my generated SAPUI5 application with a dummy label.
Select the index.html page and click on run:
In my first test I could only see the title of my SAPUI5 app, but not my label with my dummy text!
After trying a few things, I came to the following solution. I added the following tags:
Testing this again gave me my SAPUI5 app with my dummy label 🙂
Hope this will help SAPUI5 developers that will use this template so they won’t lose too much time.
Kind regards,
Wouter
Hi Wouter,
thanks a lot for this blog post.
It needs to be mentioned that these templates offered in WebIDE have a different history (creation time, content scope, maintenance intensity) and have been provided by different teams. The one you used probably has the following problem: a View control's height is defined by its content and a Page control's height is 100% of its parent height. Putting both into each other without making sure the View has a defined height leads to collapsing.
Adding an App around fixs the issue because the App sets 100% height to itself and all parent nodes.
From the templates listed, I know the following two: "SAPUI5 Master-Detail Application" and "SAPUI5 Worklist Application" and personally I can say that these two are up to the current coding guidelines, they are continuously developed further, and they are regularly tested. There are sometimes bugs, but they are usually recognized and fixed quickly, so I would say they have a certain level of quality that I would trust.
This is not saying the others are not as good, I just don't know them because they are developed elsewhere.
I'll see whether I can report this issue.
Regards
Andreas
Hi Andreas,
Thank you very much for your feedback and explanation! It explains a lot.
Just wanted to share this so that other developers won't use too much time when they start from this template.
Kind regards,
Wouter
Thanks Wouter
this helped.. I was struggling with this ... this template was not working for me.
I am not sure earlier the folder structure was different for this template where we used to have view and controller under the Viewfolder. now we have webapp folder and separate folders for view and controller.
anyways thanks a lot for this blog.
Hi,
if you go in the Layout Editor mode, and you select the View1.view.xml in the Outline, then you will be able to set 100% height to the view.
Regards,
Rachid