cancel
Showing results for 
Search instead for 
Did you mean: 

how to align a button

Former Member
0 Kudos

Hello,

I have a buttonrow, with several buttons inside. I have this one button that does not contain a text, bu rather an image. My image source is a SAP icon.

The thing is, the button that only has a image is misaligned. The button is aligned higher than the rest. When I put a text on the button together with the image, it aligns together with the rest.

Is this a possible sap bug? or is there a workaround to this?

regards,

arnold

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

HI Arnold

Make the <b>imageFirst</b> property of the button for which you added SAP icon , to FALSE and check

Best Regards

Chaitanya.A

Former Member
0 Kudos

Hello Chaitanya.A,

I tried what you said, but it didn't do anything. It still misaligns the button from the other buttons. I tried to place a blank on the text, but it didn't accept the blank.

regards,

arnold

Former Member
0 Kudos

Hi Arnold

If you want to place a blank , as your text , then create a value attribute and bind that to the TEXT property of the button and use the following code

wdContext.currentContextElement().set<value atribute>(" ");// give a space between double quotations.

Best Regards

Chaitanya.A

Former Member
0 Kudos

Thanks Chaitanya. I guess this is a way to solve it.

Answers (1)

Answers (1)

sridhar_k2
Active Contributor
0 Kudos

Arnaldo,

To Make all buttons same size,You can specify the size the buttons to same width, like 80px. Try managing the size of the image (mspaint etc.).

Regards,

Sridhar

Former Member
0 Kudos

Hello Sridhar,

I tried to change the width, but it still misaligns the button. Is there a way to change the height? I don't see any property for the height, just the width.

regards,

arnold

sridhar_k2
Active Contributor
0 Kudos

Arnold,

Try keeping a some spaces with your image, thru your code.

If you want to have your image first, make 'imageFirst=true' or if you want to show space first before image, than make it as false.

you can set image text with spaces like this.

wdContext.currentContextElement().setButtonText(" "); // buttonText - is your context variable which is binded to the button text.

It wont solve your problem 100%. But at least your Screen wont look awkward. It is better keep text or text+images to all the buttons.

Regards,

Sridhar