cancel
Showing results for 
Search instead for 
Did you mean: 

Urgently: May add a [x] button on top-right pop-up window to close it?

Former Member
0 Kudos

Hello all,

    May i add May add a [x] button on top-right pop-up window , when i click this button it close pop-up window? My NWDS is 7.3

Thanks.

Reefish

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Ree

Follow this:

1) Create an eventHandler in the pop-up Window (not view), call it close.

2) In the new created eventHandler call the component controller method that closes/hides the pop-up.

3) in the wdDoModifyView method of the pop-up Window (not view) add the following code:

if(firstTime)

{

     IWDWindowViewElement win = (IWDWindowViewElement)view.getRootElement();

     IWDAction closeAction = wdThis.wdGetAPI().createAction("close", wdThis.WD_EVENTHANDLER_CLOSE, false);

     win.setOnClose(closeAction);

}

hope it's helpfull.

Former Member
0 Kudos
HI

best regard

reefish

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi all,

   Are there any web dynpro java specialists can help me to solve my problem.

   Does Amol Gupta online, can you help my problem please.Thanks.

best regard

Reefish

amolgupta
Active Contributor
0 Kudos

Hi Fish Ree,

In WebDynpro Java, you can put an image on a button with no text.

Put a WebDynpro Button (at top right corner) with a |X| image on it, and implement the WebDynpro code as mentioned above by another fellow member.

The look and feel will be very close to what you want, just that it will be handled in WebDynpro Java.

Hope it helps !

Thanks and Regards,

-Amol Gupta

Former Member
0 Kudos

HI Amol Gupta:

  I vever though the way you remind. There is no problem to add a icon on RootUIElementContainer of pop-up window.

The web dynpro pop-up window has the default title  But i want to add the [X] icon to title area.
My question is may i add one [X] icon to the default title of the pop-up window implement the close action and

how can i do it.

thx

Reefish

Sharathmg
Active Contributor
0 Kudos

Hi Reefish,

SAP does not provide default button similar to adding the title as depicted in your image.

You have to try the workarounds suggested in earlier posts.. to give a feel of close button to the user.

Regards,

Sharath

amolgupta
Active Contributor
0 Kudos

Hi Ree Fish,

How about implementing your own title bar in WebDynpro like a image, just like we worked around the |X| button ?

Try a couple of options, play around with the UI. You should be able to achieve it with a little bit of lateral thinking like we did for the |X| button !

You will not get the exact thing out of the box, you will have to work around it, if you really want it.

Thanks and Regards,

-Amol Gupta

vijay_kumar49
Active Contributor
0 Kudos

Dear Fish Ree

I will give one idea for that requirement

  1. Create popup window

IWDWindowInfo windowInfo = (IWDWindowInfo)  

                                                 wdComponentAPI.getComponentInfo().findInWindows("<windowname>");

IWDWindow window = wdComponentAPI.getWindowManager().createModalWindow(windowInfo);              

wdContext.currentContextElement().set<contextattributename>(window);

window.show();

2. in that window you have to create one button. Add that “Close” image to that Button

3.  inside that button action.you will write this code.

IWDWindow window = wdContext.currentContextElement().get<attributename>();

window.destroyInstance();

Hope this help !!!

Regards

Vijay K

Former Member
0 Kudos