cancel
Showing results for 
Search instead for 
Did you mean: 

Change Layout in ScrollContainer

Former Member
0 Kudos

Hi,

I would like to change dynamically the layout of a ScrollContainer that I created dynamically:

IWDScrollContainer shlpcontainer = (IWDScrollContainer)view.createElement(IWDScrollContainer.class, "name");

I would like to set the layout to GridLayout and be abble to set also the ColCount.

Thank for the help,

Joseph

Message was edited by: joseph fryda

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Joseph,


        IWDScrollContainer shlpcontainer = (IWDScrollContainer)view.createElement(IWDScrollContainer.class, "name");
	IWDGridData gdInputFields =
		(IWDGridData) shlpcontainer.createLayoutData(IWDGridData.class);
		IWDGridLayout glInputFields =
			(IWDGridLayout) shlpcontainer.createLayout(IWDGridLayout.class);

		glInputFields.setColCount(4);
		glInputFields.setCellSpacing(3);

Hope the above code helps you. If you require any further clarification let me know.

Regards,

Santhosh.C

Former Member
0 Kudos

This is not quite correct.

The layout data of the scroll container refer to the layout of its <b>parent </b>container (if any) and has nothing to do with the layout of the container itself.

So if you set the layout of a container to e.g. GridLayout, you have to create GridData for the <b>children </b>of this container, not the container itself.

Armin

Former Member
0 Kudos

Hi,

Sorry. I must have removed the following lines.

IWDGridData gdInputFields =

(IWDGridData) shlpcontainer.createLayoutData(IWDGridData.class);

Regards,

Santhosh.C

Answers (1)

Answers (1)

Former Member
0 Kudos

thank you