Showing results for 
Search instead for 
Did you mean: 

SDK - New Custom component

0 Kudos

Hi all,

I'm trying to understand how I should create a custom component based on the SAP documentation, and I have some questions:

  1. The contribution.ztl file contains the setter and getter of the properties I define for my component in the contribution.xml file?
  2. I can include new method in the contribution.ztl file....Can I call a javascript function that I defined in the component.js file from the there? how? May I pass parameters?
  3. When I define a component in the contribution.xml file, how should I associate a css for my component?

Thanks in advance!


Accepted Solutions (0)

Answers (1)

Answers (1)

Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Federico,

welcome in the context of SDK component development!

I will try to answer your questions, the answer will be short as I do not know how much have you seen of the examples or our community components.

in this path you can see the community implementations, those are starting with simple and landing in complex components: sdkpackage/src/ at master · org-scn-design-studio-community/sdkpackage ·...

-> we have a bit infrastructure behind, so you can see the contribution files under each component under "def" folder.

Main Community blog:

Technical View on Repo: SDK Development Community Git Repository (sdkpackage)

here you can see our generated documentation, this can help you understand the scripting parts, check this link: Component List - SCN Design Studio Community

To your questions:

1. this should be already in the SDK documentation, basically the XML file is to define the properties. and this is enough to run the component w/o dynamic. ZTL file is to make dynamic extensions of the BIAL script, then you can change the components also dynamically.

2. NO. Not directly, all you can make in the ZTL is to set the properties. Once a property is changed - it will be send to frontend by the framework. and then you can react in frontend on it in "afterDesignStudioUpdate" method (or directly in the set<Property> method). in ZTL you can use a lot of Java Script logic + BIAL scripts.

3. the CSS assignment is made automatically, if you mean attachment of the custom CSS in component properties.

Please check the examples provided in the help portal (linked from the documentation) and the community components. Then, feel free for any other questions.

Regards, Karol