Skip to Content
avatar image
Former Member

Get all button ids?

Hi everbody,

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

Best regards

Yannick

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

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

    You may use a jQuery.

    var aButtons = $('.sapMBtn');
    
    
    
    Add comment
    10|10000 characters needed characters exceeded

  • Mar 12, 2017 at 04:08 PM

    what's the point?

    Add comment
    10|10000 characters needed characters exceeded

    • 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.

  • Mar 12, 2017 at 06:47 PM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 13, 2017 at 04:52 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded