Skip to Content
0

Get all button ids?

Mar 12, 2017 at 04:01 PM

131

avatar image
Former Member

Hi everbody,

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

Best regards

Yannick

button | get | id
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

4 Answers

Best Answer
avatar image
Former Member Mar 13, 2017 at 02:06 AM
0

You may use a jQuery.

var aButtons = $('.sapMBtn');


Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Perfect! Thank you very much :)

0
Jun Wu Mar 12, 2017 at 04:08 PM
0

what's the point?

Show 5 Share
10 |10000 characters needed characters left characters exceeded
Former Member

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

0

what you will do with all the button?

0
Former Member
Jun Wu

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

0

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

0
Former Member
Jun Wu

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.

0
Jun Wu Mar 12, 2017 at 06:47 PM
0

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.

Share
10 |10000 characters needed characters left characters exceeded
A K Mar 13, 2017 at 04:52 AM
0

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.

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Thanks! The code idea from seungchul works for me

1