cancel
Showing results for 
Search instead for 
Did you mean: 

Setting "hAlign" property through Web Dynpro API - Java

Former Member
0 Kudos

Hi

We are using Web Dynpro (for Java) API for showing graphs (Business Graphics) - Web Dynpro Dynamic Programming.

The issue we are facing is - We are not able to set the "hAlign" property for the container or the graph element through the code/API. Our aim is to align the graph to the center of the screen.

Could anyone help us with this?

Accepted Solutions (1)

Accepted Solutions (1)

former_member197348
Active Contributor
0 Kudos

Hi Aditya,

To set the "hAlign" property, you need to have Grid Layout for th container. And test with <i>StretchedHorizontly</i> also [I just forgot whether this is somethig to do with <b>hAlign</b>]

regards,

Siva

Former Member
0 Kudos

Thanks for replying Siva.

Yes, I understand that the container needs to have "Grid Layout" or "Matrix Layout". I have created the container with "Grid Layout" and embedded a graph in it through API code.

Could you please let me know how can I set the property "hAlign" <u><b>through code/API</b></u> for the container and the element?

root = (IWDUIElementContainer) view.getRootElement();
root.createLayout(IWDGridLayout.class);
transCon = (IWDTransparentContainer) view.createElement(IWDTransparentContainer.class, "transCon");
transCon.createLayout(IWDGridLayout.class);
root.addChild(transCon);

Former Member
0 Kudos

Hi,

Try this:

root = (IWDUIElementContainer) view.getRootElement();
root.createLayout(IWDGridLayout.class);

IWDGridData rootData = (IWDGridData)root.createLayoutData(IWDGridData.class);

rootData.setHAlign(WDCellHAlign.CENTER); //Choose whatever suits you


transCon = (IWDTransparentContainer) view.createElement(IWDTransparentContainer.class, "transCon");
transCon.createLayout(IWDGridLayout.class);

IWDGridData gridData = (IWDGridData)transCon.createLayoutData(IWDGridData.class);

gridData.setHAlign(WDCellHAlign.CENTER); //Choose whatever suits you

root.addChild(transCon);

Regards,

Satyajit.

Former Member
0 Kudos

Thank you very much Satyajit.

Your suggestion solved our issue.

Answers (0)