cancel
Showing results for 
Search instead for 
Did you mean: 

Get all button ids?

Former Member

Hi everbody,

is there a function/method to get all button ids from a view?

Best regards

Yannick

Accepted Solutions (1)

Accepted Solutions (1)

former_member232384
Participant
0 Kudos

You may use a jQuery.

var aButtons = $('.sapMBtn');


Former Member
0 Kudos

Perfect! Thank you very much 🙂

Answers (3)

Answers (3)

karthikarjun
Active Contributor
0 Kudos

you can follow seufchul idea, meanwhile please find below code for your reference...

var vbox = new sap.m.Vbox({

items: [new sap.m.Button(), new sap.m.Button()..........etc.]

});

//Get all buttons:

vbox.getItems(); // it returns all items inside the box.

Former Member

Thanks! The code idea from seungchul works for me

junwu
Active Contributor
0 Kudos

no direct api, I think.

for the project you are doing, I got a bit point, but not full picture..

usually you know how many buttons are there in a page, and u know the IDs

when you store the click related data to db, you can also save the view id with it.

junwu
Active Contributor
0 Kudos

what's the point?

Former Member
0 Kudos

I need a overview for all buttons in my application and I don't want to do it manually.

junwu
Active Contributor
0 Kudos

what you will do with all the button?

Former Member
0 Kudos

For example I want to analyze which one is the most clicked but also which ones exist!

junwu
Active Contributor
0 Kudos

don't know what u are talking.....

Former Member
0 Kudos

I need all button ids from a view because I want to analyze for every view and every application which ones are the most clicked buttons in a view. It is simple to check which one is the most clicked button because I can save every time the id in a table when a button is clicked.

But when I want to know which one is the less clicked button I need all button ids for a view because I don't know if a button exists when it's not clicked.

I need it for a study project.