cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic screen layout

Former Member
0 Kudos

Hi,

The way we can create UI elements programmatically, can we create layout for a group or for a container in the same way? APIs like IWdGridLayout are available but it does not allow to create instance of it(it gives runtime exception). Also, I can specify the layout but can not alter its properties like colCount, colSpan etc.

Please help.

-Tejal

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Just check this code snippet.

IWDTransparentContainer finContainer = (IWDTransparentContainer)thisView.createElement(IWDTransparentContainer.class,"FinContainer"+idIndex);

IWDGridLayout layout =(IWDGridLayout)finContainer.createLayout(IWDGridLayout.class);

layout.setColCount(4);

IWDGridData finLoanGrid = (IWDGridData)finLoanTxt.createLayoutData(IWDGridData.class);

finLoanGrid.setColSpan(4);

Hope this solves ur problem.

Regards,

Sowjanya.

Answers (1)

Answers (1)

Former Member
0 Kudos

Do it like this:

// get container by ID
IWDUIElementContainer container = (IWDUIElementContainer) view.getElement("containerID");
// create and set new layout
IWDMatrixLayout layout = container.createLayout(IWDMatrixLayout.class);
// set layout properties
layout.setStrechedHorizontally(false);

// ...

For the children of this container, create layout data of type IWDMatrixData or IWDMatrixHeadData and set properties accordingly.

Armin