cancel
Showing results for 
Search instead for 
Did you mean: 

SDK - Possible to change Layout properties in design time?

Former Member
0 Kudos

Hi guys,

there are some layout properties you can change while you are in design time, top margin - left margin....

I want to change them e.g on button press in additional properties.

Is that possible?

What I found is this.owner.oComponentProperties.margintop, but nothing happened after I set it to another value.

best regards

Accepted Solutions (1)

Accepted Solutions (1)

daniel_appelt
Explorer
0 Kudos

Hi Juri,

you could try to access / modify the following properties from your additional property sheet:

WIDTH

HEIGHT

TOP_MARGIN

RIGHT_MARGIN

BOTTOM_MARGIN

LEFT_MARGIN

CSS_CLASS

DATA_SOURCE_ALIAS_REF

Those properties are not documented in the SDK. For some purposes it is essential though to know whether they have changed in the regular properties dialogue. For example, keeping track of DATA_SOURCE_ALIAS_REF is useful if you are presenting a list of dimensions to select from in the additional property sheet.

Cheers,

Daniel

MustafaBensan
Active Contributor
0 Kudos

Hi Daniel,

That's very useful to know, thanks.  Can you elaborate a little on how the DATA_SOURCE_ALIAS_REF property can be used for presenting a list of dimensions in the additional property sheet?

Regards,

Mustafa.

Former Member
0 Kudos

Thanks Daniel! It works, I had the wrong property name

daniel_appelt
Explorer
0 Kudos

Hi Mustafa,

with DATA_SOURCE_ALIAS_REF you will only be notified of a different selection of data source in the regular properties dialogue of a data bound SDK extension. You will receive the data source's identifier ("DS_1" for example) only. In case this happens, you would need to update the corresponding dimension metadata in the additional property sheet yourself.

One way to do this is to use the SDK's callRuntimeHandler method. In this case, you would need to provide a separate getter method in your component which returns the metadata it receives for data binding in JSON format - I believe callRuntimeHandler calls are only allowed to returned the SDK subset of JavaScript data types, i.e. int, float, String etc.

Kind regards,

Daniel

Answers (1)

Answers (1)

MustafaBensan
Active Contributor
0 Kudos

Hi Juri,

If you simply want to provide the ability to change layout of standard or SDK components based on events such as a button click during run-time, this can be done with standard BIAL scripting as shown below:

In design-time, the layout properties can be changed via the Standard Properties sheet.  Can you clarify why you need to be able to change the standard layout properties in the Additional Properties sheet?

Regards,

Mustafa.

Former Member
0 Kudos

Hi Mustafa,

I build a component, that has different container. Usually you can just drag the whole component,

but I managed it, that in design time you can drag also the inner container in the component.

When I move it, the layout properties change - I want to save them, what I already did, and modify them in the SDK.

Changing them in Additional Properties was just an example, the goal would be, setting that layout properties in background(SDK), without clicking anywhere.

MustafaBensan
Active Contributor
0 Kudos

Hi Juri,

That sounds like an interesting component.  Based on your example statement of this.owner.oComponentProperties.margintop, it seems like you are extending a UI5 control.  Is that the case?  This may influence the approach for updating the layout properties.

Also, are you triggering the fireDesignStudioPropertiesChanged event after changing the layout properties?

Regards,

Mustafa.

Former Member
0 Kudos

It's the "component" layout properties I want to change, not to extend, like the example above in the screenshot - but not with BIAL