Design Studio SDK (1.3) – Fiori-like LaunchPad (aka sap.m.TileContainer)
Be sure to check out Part 2 of this component:
Update (10/10/2014 evening):
Added another property for the Tiles to set a CSS Class to them. This will allow you to apply CSS formatting per-tile which may aid with Alert-based color formatting based on your target thresholds (coloring sizing etc)
Fixed a bug reported in the comments here: Design Studio SDK (1.3) – Fiori-like LaunchPad (aka sap.m.TileContainer)
After making a Fiori-like PopOver Button, I started wondering what other sap.m/Fiori-like components would be a logical addition to a Design Studio application. One that I’ve always liked is the sap.m Tile Container or what is labeled a LaunchPad in Fiori terms.
- sap.m TileContainer Sample
- Fiori Launchpad Sample A Cloud-based Fiori Launchpad – a perfect use case for the HANA Cloud Portal
For those who didn’t click the links, here’s a basic example from the sap.m TileContainer Sample:
Basically a grid-layout of tiles, but purposed to give you some high-level information and instigate guided navigation to more detail upon click.
This may look familiar for those who have seen the KPI template in Design Studio 1.3:
While I think the KPI Template provided with Design Studio is a good start, it’s susceptible to some of the same manual labor I mentioned in my previous blog related to positioning individual pieces to compose a tile. Now, this has its merits where you can switch out a number for a chart or a simple crosstab, as well so there are definitely needs for both.
How about a programmatic way of constructing structured tiles? We have this today thanks to SAP if you’ve played with SAP’s KPI Tile extension from their SDK Samples:
This is a nice component if you are OK with this structure (and some CSS classes to support cosmetics). So what if we’d like to do a little of both without a lot of repetition?
Below is my attempt to provide a TileContainer for multiple similarly structured KPI Tiles. Below is a design time example:
As you can see, this is very similar to the Fiori LaunchPad and TileContainer examples mentioned at the beginning. You also will see the Properties Panel on the right showing the ability to add new tiles with the following properties:
- Info (bottom right)
- Info State (Success, Warning, Error, None) – aka (Green, Orange, Red, Black) – Handy for alert-based visuals
- Number Unit
Also during runtime we have the following BIAL Methods:
removeAllTiles() — Removes all Tiles
removeTile(title) — Removes Tile with title passed
getTileProperty(title) — Returns JSON structured tile configuration for a tile by title with properties title, info, icon, number, numberUnit and valueState returned.
addTile(title, info, icon, number, numberUnit, valueState) — Adds a new tile (or updates one if the title already exists)
I bolded and colored this one because this is how you would pass data to it in BIAL from your DataSource. In other words, I did not make this LaunchPad databound because you can get away with passing single KPIs to multiple tiles from multiple DataSources using BIAL to get around the single DataSource limit on SDK components.
Finally, we have an On Tile Select script event to facilitate the navigation logic during runtime. Example BIAL for this:
Of course replace this with some BIAL of your choice, the sky’s the limit from there!
And another BIAL example below for doing various methods:
Also, as a bonus, by reusing the functionality of sap.m.TileContainer, it handles responsive layout and tile pagination for us automagically. Let’s resize our window and see:
And let’s try real narrow just for another example:
And here’s a crude video animation capture of the resize animation at runtime. (It’s much smoother in person):
(Click if it’s not animating for you)
This ONLY works when Blue Crystal Theme is selected! Older UI5 themes are not compatible.
As with my other entries, the source code will be updated on my Github Repository that you can read about here.
Design Studio 1.2/1.3 SDK – Design Studio Utility Pack
Feedback welcomed. Enjoy!
Did you add this to the online repository ? I just refeshed but couldn't find it.
Cheers, and keep your excellent work coming ! It helps a lot in understanding the ins and outs of DS.
Yes it should be updated in the ZIP and also online repo. You may have to restart DS if you've had it running since before I updated. (It caches uodate checks)
If that doesnt work, an uninstall/reinstall of my addon should do the trick.
I couldnt find the tile container, would appreciate if you could put the tile container on your repo 🙂
SCN Design Studio SDK Development Community
another big THANK YOU! Sorry i'm repeating but that is really great that you do all the work and share it with all of us!
Great Work Michael ! Truly appreciate your spirit of sharing the innovative ideas to the SCN community.
it looks great in the screenshots. Thanks for providing this great code! 🙂
I'm trying it out, but I somehow can't get it to work.
I always get the same error in the trace log:
My script with the launchpad just calls
So there shouldn't be a problem from what I read in your description.
Also, in your screenshot, entries in the "Additional Properties" are visible. Is that also included in the distributed version? I don't have anything there.
I made sure to have the "Blue Crystal" theme selected as well as the "NEW_DESIGN_FONT.css" as Custom CSS and I'm on DS 1.3 Patch 1.
Something else I could be doing wrong?
Phillip - Thanks for the feedback!
You've found a bug for sure (I'll fix shortly). This looks like if you add a tile on a launchpad that has no tiles yet, you will get this error. As a workaround, can you add this line right before your line?
LAUNCHPAD_1.removeAllTiles(); // Fix for uninitialized array bug
The CSS is not needed, by the way.
Michael, thx for the quick help.
That did the trick.
No problem, I've also updated the Github repository and online repository to include this bug fix.
Thanks for another great SDK component!
Is it possible to add tiles dynamically when looping through a data source which has all the required elements for the Launch Pad as dimensions (title, info, icon, numberUnit etc.) and measure (number)?
Thanks for your feedback.
I think you should be able to via BIAL scripting dynamically add tiles to the Launch Pad. The only *required* field it 'title', and the subsequent parameters can be left off, or skipped with at blank "" parameter. Note that all parameters are of type String, and it's really up to you as which parameter you want to be used for placement on the tile. For instance, you can pass the measure (as String) to the title or info parameter if you want a different look.
The only 'special' parameter would be icon, since that's obviously meant for iconography.
Hope this helps!
I tested yesterday and used a loop over an array to create and fill the tiles. It worked fine and I was able to create one tile per key figure in the query. I also played around a bit with the scaling factor and the unit being shown in the tile.
Below is my example (I used a listbox for a change of sales organization and called the creation based on that. That's why there're calls for the listbox included.):
Hope it helps.
This is pure awesome, Phillip! I am in the process of posting a blog entry with something very similar but also showing how you can use CSS styles to make change the tile appearance with alert-based thresholds in the script.
Thanks for sharing your code. Could you take a snap shot of the initial view of your data source DS_1 and the final result with tiles?
I can't post the data.
But it's very straight forward. I have an initial view, that consists of several lines with the sales organization. If filter in my listbox on one of them, and build the tiles based on the event from the listbox. That's the code I posted.
For my example to work, I just had to make sure, to return one line of data (after I filtered on the sales organization).
No worries, Philipp. If you need to create, say, 6 tiles dynamically, and you work with a data source which contains the following 6 lines of data and 5 columns, would it be possible to fetch the data at once without using setFilterExt to fetch a line at a time?
my script was just an example. In my case, users always want to restrict on a specific sales organization, and I wanted to create the tiles accordingly (and it was just simpler to create the tiles from one-liners).
Of course it should be possible to derive the data also from the lines you posted. You can either go from the columns and create an array for every dimension and loop over all of them to fill your entries. That's not very nice though. But there's no easy way to jump to an specific array index (yet).
Or you can go from the lines and use different key: value paires with getDataAsStringExt to go from there.
Just my 2 cents, Philipp
Thanks a lot for your great work.
I tested it and wonder if it's possible to assign different "On Tile Select" script to different tiles?
Thanks for the feedback, Alfred.
You could facilitate different logic by using the On Tile Select Event and the getTileClicked() to determine which tile was clicked and then write your corresponding script in that if statement.
Oh, I see! getTileClicked() returns the Tile Title. Now I know how to do it.
Thanks a lot.
thanks for this great post.
I would like to reduce the height of the launchpad, but the tiles are being cut off.
In the additional properties, I can assign a custom css to each tile. Can I use this to modify the tile height? If yes, what would be the css tag to address the tiles?
nice blog. Is there any option to integrate a Design Studio Report as a Tile into Fiori Launchpad (ABAP) ?
As far as I am aware, direct integration of Design Studio apps into the Fiori Launchpad is only available with the Simple Finance (sFin) Wave 6 as discussed in the post Design Studio integration with Fiori, which also references SAP Design Studio on SAP HANA: Integration with Fiori Launchpad as another option.
More recently, the Question and Answer from World Premiere SAP Design Studio 1.5 ASUG Webcast makes a reference to the possibility of publishing Design Studio applications deployed on the BI Platform to the Fiori Launchpad with some configuration.
I don't understand. Are you describing a new Component? How do we get this component and how do we install it so we can use it in a Design Studio dashboard?
Yes, it is a new component. You can find more information about our SCN community extensions with download link here:
SCN Design Studio SDK Development Community
First I want to thank you for all those extra functionalities you and a lot others (from the SDK Development Community) have created!
I'm using Design Studio since a couple of months and and several components brought up are really useful for me!
This functionality seems really useful as well, but i'm looking for a solution in which you can add a graph (or a speed-o-meter). But i need the same dynamic as in the LAUNCHPAD example. Do you know if there is such a component available? or any other examples?