cancel
Showing results for 
Search instead for 
Did you mean: 

Lumira Designer Composite Script for navigation in application?

07-05-2018 10:45 AM
mario_panzenboeck Contributor
1689 views 4 comments Go to solution
0 Likes
SAP Managed Tags
Subscribe

Hello,

I am using several composites in my application. On of my composites is a header with several buttons. When I click the botton the pagebook selection should change.

The problem is, that the header is a standalone composite, the pagebook is embedded in my application.

So if I use the onClick event based on the buttons (in the composite) I am not able to adress the pagebook in the application.

I know the functions of the composites - there it´s possible to pass variables from the application to the composite. What to use if I want this to go in the other direction (composite -> application)?


Thanks and best regards,

Mario

0 Likes

Accepted Solutions (1)

Accepted Solutions (1)

mario_panzenboeck
Contributor
0 Likes

I solved this using Events. Just defined Events on the composite.

In the application I "catch" the event and do the navigation steps according to the buttons/icons the user clicked.

Answers (1)

Answers (1)

0 Likes

Hello Mario,

Can you please help me here with understanding the composite component?
What is the use of composite?

Can we have more than one component inside a composite? If yes then how we handle the events on each of the component (for eg: if I have used 3 buttons in a composite how can I handle click of each button).

Thank you!

mario_panzenboeck
Contributor
0 Likes

Hi Rafat,

for details regarding composites you can read this blog here:

https://blogs.sap.com/2017/10/04/sap-lumira-2.0-designer-composites/

The primary use of composites for me is that you can use them multiple times in one application and if you need to change something you only have to change the composite once and all other objects gets updated / changed automatically. A composite can contain more than one components. For example you can design your own tiles with a text Header, a bullet KPI chart and also a subheader.

If you want to trigger something when a user clicks a button (which is in the composite) create three events for the buttons inside the composite. For example ClickButton1, ClickButton2, ClickButton3.

Select button 1 in the composite and go to the "on click" Event:

COMPOSITE.fireEvent(ClickButton1);.

Do the same for button 2 and button 3 with ClickButton event 2 / 3.

Save the composite and go back to your application.

Insert the Composite to your application outline and select it. In the properties window you will find the created events. For example select event ClickButton1 and insert the following code:

APPLICATION.alert("Button 1 clicked");

So if you click button 1 a message should appear with "Button 1 clicked". Please note that this is only working while you are running the application in local mode and not on the BI platform. You can change the code to your needs.

Hope this helps!

Br, Mario

0 Likes

Hello Mario,

Thank you so much for replying.

I was successfully able to achieve what I asked for.

Now I have a better understanding about the composites. I also referred the blog you mentioned above.

I was able to implement in local mode but I get error when I try to upload the dashboard to BI launchpad saying "only self contained documents can be uploaded".

Is there any way to upload application which uses to BI launchpad?

Regards,

Rafat