cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SAP Build work zone, SAPUI5 app, controller not executing

SailiRBendale
Explorer
0 Likes
3,649

Hi Folks,

I need your expert advice for an issue that I am facing when I deployed a simple UI5 application to cloud foundry.

I have created a simple UI5 which has a button and a label element, on press of which a function is called which displays a MessageBox. 

In view controller, I have added a MessageBox in init, just to verify is init is being called.

When I run the app with no-flp and sandbox, it runs perfectly fine.

When I deployed the app to cf , it is working fine when I open the app from HTML5 applications(I added FLP config while creating project).

Now when i ran the same app on Build Work Zone, the View controller is not loaded. The message box in init as well as button event is not displayed.  I observed that when I inspect the app, the controllers are not loaded in sources tab.

I need your advice for this issue.

Accepted Solutions (1)

Accepted Solutions (1)

liutiuriu
Explorer
0 Likes

I encountered a similar issue. If the app is run directly on BTP: HTML5 Application, it works fine. However, if it's run on SAP Build Work Zone, the controller does not seem to function.

VaradBhagwat
Explorer
0 Likes
Same issue and this is happening only for new apps created ... not sure since when but since last week I'm facing this problem. Existing apps are working perfectly when executed on the Workzone !
SailiRBendale
Explorer
0 Likes

We further analyzed the issue and found that when the app is executing in WorkZone, 2 component-preload.js files are loading (inspected the app). One file has proper data and other one has incomplete data.

In order to overcome this, we did 2 settings.

1. ui5-deply.yaml : added below section under builder

  componentPreload:
    excludes:
      - "testworkzone/controller/**"
 
2. change package.json build script
    "build": "ui5 build --config=ui5.yaml -a --clean-dest",
 
With these 2 settings, the app worked perfectly.
 
PS: I am using trial account , US East(VA).
SailiRBendale
Explorer
0 Likes
Do let us know if you find an alternate work around for this.

Answers (2)

Answers (2)

DiegoValdivia
Active Participant

Hi,

I was having this same issue but have solved it now.

It seems some SAP guy was playing around last week with the BAS Fiori Generator and added some bugs to the App Controller. We can tell because they added some sapui5 walkthrough code.

I performed the following fix and my app started to work

DiegoValdivia_0-1733419101624.png

Regards.

 

VaradBhagwat
Explorer
0 Likes
Thanks a lot. your suggestion resolved the issue. Spot on 🙂
SailiRBendale
Explorer
0 Likes
Thank you very much.
liutiuriu
Explorer
0 Likes
Thanks very much. It's exactly problem xD
manishmatte1753
Explorer
0 Likes

Hi @DiegoValdivia, i tried your solution and it worked, but when i reload the launchpad/workzone, its does not load the application, and i mean the ui does not render.

UPDATE : well it seems to work, i think somethings wrong with my app.

manishmatte1753
Explorer
0 Likes

My fiori apps are getting same code in App js as the View1 controller...lol

manishmatte1753
Explorer
0 Likes
Hi @SailiRBendale, i tried your solution and added the code in ui5-deploy.yaml and the script in build:cf, but this solution does not seem to work for me, please let me know if you found any other way to solve this issue. Thanks.
junwu
SAP Champion
SAP Champion
0 Likes

is your app working or not?

controller not loading means nothing.

the component-preload file may have everything.