cancel
Showing results for 
Search instead for 
Did you mean: 

Use new UI5 control in webIde

Former Member
0 Kudos

Hi,

I've create new UI Control via extend command and I want to use it in the SAP WebIDE (which is nice tool)  from diffent plugins and files.

Since I new to this topics (create new UI5 control and using the WebIDE) I need  is a step by step guide in order to expose it?

I think I should use Define/ Declare and maybe use the re-use library  but not sure how to do it right and I didnt find any helpful documents about this topic...

Regards,

Stephane

Accepted Solutions (1)

Accepted Solutions (1)

former_member182372
Active Contributor
0 Kudos

use  jQuery.sap.require in case controle is within your project.

if it is in a different project use

jQuery.sap.registerModulePath

first to declare a mapping to external resourcs

SAPUI5 SDK - Demo Kit

Former Member
0 Kudos

HI Maksim

Should I use somehow the re-use library mechanism ?

Thanks

Stephane

former_member182862
Active Contributor
0 Kudos

HI Stephane

Depending on how you structure your code

    'use strict';
    jQuery.sap.declare('your.company.controls.Sample');

    sap.ui.core.Control.extend('your.company.controls.Sample', {
        renderer : function(oRm, oControl) {
            oRm.write('<div');
            oRm.writeControlData(oControl); 
            oRm.writeStyles();
            oRm.write('>sample');
            oRm.write('</div>');
        }
    });

-D

Former Member
0 Kudos

HI Dennis,

So for using it in the web IDE from different project I just need to declare and Define  the new control?

Thanks!

former_member182862
Active Contributor
0 Kudos

use jQuery.sap.declare

and then in places when you need it use jQuery.sap.require

Thanks

-D

Answers (1)

Answers (1)

karthikarjun
Active Contributor
0 Kudos

Hi Stephane,

This link will help you to develop new UI5 controls.

https://www.nabisoft.com/tutorials/sapui5/creating-custom-controls-in-sapui5

Before going to this topic, you should know about JS classes and HTML5 basics.

Thanks,

Karthik A