cancel
Showing results for 
Search instead for 
Did you mean: 

MDK Extension Control Using Standard Control

lokesh_kamana
Active Contributor
0 Kudos

Hi All,

We have a specific requirement where we have to write a mdk extension control. But most of this is already available in standard control only issues we have are below.

Control Used :- section.Type.ImageCollection

Limitations:-

  1. Align the cells to center of the page.
  2. keep the cells center aligned.
  3. Text should not be wrapped - show full text

Question:- Since standard only allows to extend icontrol,iview. What we want to know is there a way for us to get the swift source code generated by SAP for ImageCollection use it and create over own control.

custom-mdk-control.jpg

Accepted Solutions (0)

Answers (1)

Answers (1)

bill_froelich
Product and Topic Expert
Product and Topic Expert
0 Kudos

We are unable to provide the underlying source code.

The MDK Image Collection on iOS is using the SAP BTP SDK for iOS Collection view to display the cells. You can look at the native SDK code for examples on how this might be implemented natively and from there see about modifying it to suit your requirements.

lokesh_kamana
Active Contributor
0 Kudos

Hi Bill,

Thank you very much for your response and feedback. We did try this approach and one place where we are currently struck is reading image in the extension control .ts file.

I tried the below options and nothing worked.

  1. Putting it in metadata images folder and reading didnt work.
  2. Plugin module included the image file that also didnt work.

And one more question is there a easy trick to access the sap-icon:// in the extension control we build. Any response or help will really help we are really struck on this right now.

bill_froelich
Product and Topic Expert
Product and Topic Expert
0 Kudos

If you extend from IControl, you can add a resolve method to your class.

private resolve(v: any): Promise<any> {
    return this.valueResolver().resolveValue(v, this.context);
}

Then depending on how you are passing your image references you can call the resolve method passing the metadata image path and it will return the Base64 encoded image.

this.resolve(this.definition().data.ExtensionProperties.Image1).then((image1) => {
    console.log(`Image1 Resolved`);
});