![how to get core gragments how to get core gragments](https://heavy.com/wp-content/uploads/2019/10/destiny-2-decryption-core-fragments.jpg)
Inside of the controller in which our button is was placed (typically named the same as your view name) we will place the stub for our controller code. Create the function onOpenFragment and load the fragment The 'text' attribute is the text which will appear inside of our button. The 'press' attribute is the name of which function our button press will call. Create our buttonīuttons are very easy, in our view (mine is called mainView) and I add the following XML inside of my content/ the area where I want my button to appear. So if you're using WebIDE or Business Application Studio just use a standard Fiori template and I will be using a template from my own npm package ExpressUI5. The same as almost all of my blogs, I get started with a completely blank SAPUI5 project so nothing extra and nothing fancy. Fragments do not have their own controller so all our JavaScript will live inside of the controller where we instantiate the fragment. I hope to write more on SAPUI5 for the rest of the year as I'm currently working on a project using SAPUI5, Business Technology Platform (formerly SAP Cloud Platform) and will be using things like BTP, APIM and Azure DevOps for automated deployments so stay tuned for blogs around these topics! What is a fragment in SAP UI5?Ī fragment in SAPUI5 is just a small snippet of our view code, this is re-usable and typically used for things like dialogs and fragments but can be used inside of existing views. Please be aware that It's been several months since I've done any blogs and about 10 months since I wrote anything on SAPUI5. In this post I am going to talk all about fragments! but more specifically how we can set and display data within our SAPUI5 fragments properly.