cancel
Showing results for 
Search instead for 
Did you mean: 

How to give padding while creating buttons dynamically

Former Member
0 Kudos

Hi,

In our Java WebDynpro Application we have to create buttons dynamically after checking if the user has authorization.

I am able to create the buttons and bind the action to them succesfully. However I am not able to figure out how to set the padding between the dynamically created buttons.

I have created the layout data for the buttons

iwdButton.createLayoutData(IWDGridData.class);

Can anyone please let me know how I can set the padding dynamically for the buttons ?

Right now all the created buttons are stuck to each other.

Thanks in advance for your help.

Warm regards,

Rashmi

Accepted Solutions (1)

Accepted Solutions (1)

former_member192152
Active Participant
0 Kudos

Use the same principle as the code below?


WDLinkToAction outraAprovSearch = (IWDLinkToAction) view.createElement(IWDLinkToAction.class, "lnkAOutraAprovSearch");
{
    outraAprovSearch.setImageAlt("Outra Aprovação");
    outraAprovSearch.setImageSource("~sapIcons/s_b_srcc.gif");
    outraAprovSearch.setTooltip("Permite ao usuário localizar outra aprovação.");
    outraAprovSearch.setType(WDLinkType.FUNCTION);
    outraAprovSearch.setOnAction(wdThis.wdGetOutraAprovacaoAction());
    IWDGridData gridData = (IWDGridData) outraAprovSearch.createLayoutData(IWDGridData.class);
    {
        gridData.setHAlign(WDCellHAlign.FORCED_RIGHT);
        gridData.setColSpan(1);
        gridData.setPaddingRight("15px");
        gridData.setWidth("1%");
    }
    trspContHeaderButtonsLeft.addChild(outraAprovSearch);
}

regards,

Angelo

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Angelo,

Thanks a lot, just tried it and it works just fine.

Warm regards,

Rashmi