Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

sap.designstudio.sdk.Component

Hi,

I am learning the SDK. I see that we are subclassing the sap.designstudio.sdk.Component object. In all the examples, we are to copy existing components and modify them to our needs. This is great, but where are the details on how the environment behaves? What are the methods and properties of sap.designstudio.sdk.Component? I see that init, afterUpdate and other functions get called, but what are all of the functions that get called? What properties are available?

I hope that some of these questions can be answered.

Thanks and happy New Year.

Tags:
Former Member
Former Member replied

Hi Robert,

     This is for the DIV event handler & yes the UI5 event handler use slightly different methods.    

Ok this may seem confusing but you will have to learn some Javascript, jquery basics for 'this'.In Javascript, this refers to the current scope(within a function). However when you are outside this function, the scope changes. So we cannot access objects or variables in the original function.

So we create an alias referred to as that, so that you can still access the original function.

Let me show you this with a very simple example

$('#element').click(function(){

    // here 'this' is a reference to the element clicked on(current scope)

    var that = this;

    $('.elements').each(function(){

        // here 'this' is a reference to the current element in the loop

        // 'that' is still a reference(alias) to the element clicked on

    });

});

It is not necessary that you declare it as that ,you can even declare it as

var self = this;

Or as _this as in this article Scope and this in JavaScript

You can refer to this page from jquery for the this keyword.

Yes those four events are called at runtime. You can write all your Javascript within these functions. You can use Jquery as it is already included in the SDK. You can include your own javascript libraries by using <jsinclude> in the contribution.xml file.

Regards,

Stephen

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question