cancel
Showing results for 
Search instead for 
Did you mean: 

Align Fields or Label in Webdynpro

Former Member
0 Kudos

Hi,

How I can to align label or fields or other object in a view of Webdynpro?

Thanks,

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

You have the various layouts to do the alignment. If you choose a grid layout, you can specify how many fields or UI elements you want to be displayed in a single row, by giving the col count. You can adjust the cell padding to determine the spacing between elements.

In a matrix layout, for every new line of elements, you give the data type as Matrix head data. and all other elements will be Matrix data. A row layout also works similarly.

Try creating views with different layouts and you can see the results better. Hope this helps.

Regards,

Nithya

Former Member
0 Kudos

Hi,

I've created a view and i tried with different layout, but if I insert labels and inputfields, I can't align them.

Thanks

Former Member
0 Kudos

You cannot align them by drag and drop or something. Based on the properties of your layout, they will get aligned. So it is a good idea to decide on your layout and then start designing the view.

Former Member
0 Kudos

hi,

if your container width is 100% and you only have like 2 fields (two columns)

in combination with the parameter stretched horizontally, you will spread them around,

if you don't spread, the colums will be aligned on the left side of your screen

with normal dimensions if you leave the container width blank

grtz,

koen

shwetars
Advisor
Advisor
0 Kudos

Hi Guillermo,

what exactly do you mean by "you are not able to align them", what is it that you are trying to achieve, please elaborate your problem. The solution provided by Nithya makes sense, did you try the various layouts ?

also go through the documentation at the below link for further clarity on various layouts

http://help.sap.com/saphelp_nw04s/helpdata/en/eb/128841e8231709e10000000a155106/frameset.htm

Regards,

Shweta

Former Member
0 Kudos

Hi Sweta,

If I have a grid layout and two fields with two label (label1-text: Name:, label2-text=Your father's name:) with different size, i can't align the inputted.

Former Member
0 Kudos

If you want the fields to appear as you have specified, i.e label: name, label2: name2, set the colcount property of your grid to 4.

Former Member
0 Kudos

Hi Nithya,

But If I've 8 or 9 label and inputfields and I want to show in one row 2 label and 2 inputfield in another row 3 label and 3 inputfield in other row 1 label and 1 inputield... The labels with different size. How can I align the inputfields?

Former Member
0 Kudos

One way to do this would be as follows';

Set the rootuielement container's Layout as flow layout. The elements will come one below the other.

For each row of input you want, have a transparent container. So if you want 3 rows, essentially your root should have 3 transparent containers. Inside each trans container, have your labels and input fields.

In the first container, set the layout as grid will col count = 4. Keep the width of the container as 100% so that it spans the whole screen. In the second container, keep the col count as 6. In the 3rd one, col count = 2. If all the widths are 100%, the input field sizes would get automatically adjusted.

Regards,

Nithya

Former Member
0 Kudos

Hi Guilermo,

in this case go for a Matrix layout and whenever you want to display a UI element say a label in the next row make its layout data as "MATRIXHEADDATA" instead of "MATRIXDATA".

Eg: you want to show 2 input field with label in first row and 3 input field and their labels in the next row.

all you need to do is to place them in a Transparent container or a group.Make the Layout property of it as MATRIXLAYOUT.

Then make the 1st label as MATRIXHEADDATA leave 1st inputfield 2nd label 2nd inputfield as MATRIXDATA....

again make 3rd label as MATRIXHEADDATA and remaining labels and inputfield of that line as MATRIXDATA....

Former Member
0 Kudos

Hi Rahul,

So it's like I want to show my inputfields and label. You have helped me.

Thank you.

Former Member
0 Kudos

Thanks.

Answers (2)

Answers (2)

0 Kudos

If you want to align like these fields, then we have to use a transparent container for every field.

Place all fields in GRP1 which of MatrixLayout.

And inside GRP1 all containers are FormLayout & MatrixHeadData

Former Member
0 Kudos

alternatively you can custom design by setting the no of pixels in the "width" property to change its display on the screen.Eg: 1200px will make the UI element 1200 px long.You will have to do trial and error to see what works best for your screen.hope this helps.