cancel
Showing results for 
Search instead for 
Did you mean: 

popup screen by clicking checkbox

Former Member
0 Kudos

Hi

I created web dynpro application.In that input fields,drop down box,checkbox are present.

By activating Checkbox,it has to pop-up one screen which was already developed

please tell in what way i have o proceed to achieve that.

please provide step by step document.

Thanks & Regards

Sushma

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

tx

Former Member
0 Kudos

Please have a look at the link given below

Former Member
0 Kudos

Hi Sushma,

1.Create a checkbox UI element.

2.Create a context of type boolean.

3.assign the context with checked property of checkBox.

4. Create a action at onToggle event

5. Now in the action you have created write the code for pop up window.for that follow the below link which has explained each step in detail.

https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/20d2def3-f0ec-2a10-6b80-877a71ec...

Hope this will help

Regards

Narendra

Former Member
0 Kudos

hiii

I written code.its working fine while i was selecting ""''checbox""''''

pop-up is displaying in the same screen.I want it should be displayed in the different screen.

Please give required settings to work on this.

Regards

sushma

Former Member
0 Kudos

Hi Narendra,

I have got a similar requirement but it is a bit more complex. I want the popup screen by clicking a radiobutton in a ESS iView. I have customised the iviews of ESS using NWDS and want to know the porcess of displaying a pop-up window when the user selects a radio button. Could you give me some advise over this. I would appreciate your help.

By the way, the link that you have metioned in the above post doesn't seem to be working!!

Regards,

PG.

sanyev
Active Participant
0 Kudos

Hi PG,

For a radio button you need to write the popup code in your onSelect event. The rest everything is the same as the [document|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/20d2def3-f0ec-2a10-6b80-877a71eccb68] suggested by Narendra.

Regards,

Sanyev

sanyev
Active Participant
0 Kudos

Hi Sushma,

You have to create a seperate Window and view for the popup. Embed the popup view in the newly created window and then give the Window name instead of PopWin in the code.

IWDWindowInfo windowInfo = (IWDWindowInfo)wdComponentAPI.getComponentInfo().findInWindows("PopWin");
IWDWindow window = wdComponentAPI.getWindowManager().createModalWindow(windowInfo);
window.setWindowPosition (300, 150);
window.show();
wdContext.currentPopupNodeElement().setPopupAttribute(window);

Better to write this piece of code in your component controller and create the PopupAttribute in your component controller context.

Use this code to close the popup window

wdContext.currentPopupNodeElement().getPopupAttribute().hide();

Regards,

Sanyev

Former Member
0 Kudos

Hi

I created a popup window and embed a view.I written required code(in which popup window screen should be) in the pop-up window.

wdContext.currentPopUpElement().setUserloginid("001157");

wdContext.currentPopUpElement().setExistingUser(true);

wdContext.currentPopUpElement().setUserName("Sushma");

wdContext.currentPopUpElement().setActive(true);

wdContext.currentPopUpElement().setEmployee("1");

wdContext.currentPopUpElement().setRole("3");

Here i mapped each element in thee context.

I add the code in the component controller context .

In that i created context ---"PopUpWin".under that attribute "Existing User".

.

In the Component controller Interface implementation i written code

public void wdDoInit()

{

//@@begin wdDoInit()

IWDWindowInfo windowInfo = (IWDWindowInfo)wdComponentAPI.getComponentInfo().findInWindows("EtrecPopUpwin");

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

window.setWindowPosition (300, 150);

window.show();

wdContext.currentPopupWinElement().setExistingUser(window);

wdContext.currentPopupWinElement().getExistingUser().hide();

//@@end

}

iam getting error in last two lines.

Is it correct the way i was proceed.Please guide me where i went wrong.

"""""After activating Existing user checkbox button the pop up window has to come""""""""

Thanks & Regards

Sushma

nikhil_bose
Active Contributor
0 Kudos

sushma,

posting error trace will help to identify the error easily.

if there is design time issue: change ExistingUser attribute type to IWDWindow (java native type)


wdContext.currentPopupWinElement().getExistingUser().destroyInstance();// to destory/hide

If you are getting Nullpointer exception at runtime, make PopupWin node cardinality as 1 .. 1 ; this means PopupWin element exists at runtime at once and only once.

comment: further elements can't be added to node PopupWin

sanyev
Active Participant
0 Kudos

Hi Sushma,

What you have done in the wdDoInit() of the component controller is wrong. What you are doing there is on launch of the application itself you are showing the screen and then hiding it.

If I understand your requirement correctly you need to popup a screen when someone checks a checkbox.

So first of all for the checkbox create an action called checkBoxClicked.

implementation would look some thing like this

//This is on the main view controller
public void onActionCheckedBoxClicked(){
/*
  Write code to do business logic
*/
//Launch popup window
wdThis.wdGetComponentController().showPopup();
}

In your component controller context directly under Root create an attribute "popupWindow" of type IWDWindow.

Root(node)

--popupWindow(attribute)

create a method in your component controller for showing the popup

public void showPopup(){
   IWDWindowInfo windowInfo = 
           (IWDWindowInfo)wdComponentAPI.getComponentInfo().findInWindows("PopWin");
 IWDWindow window = wdComponentAPI.getWindowManager().createModalWindow(windowInfo);
 window.setWindowPosition (300, 150);
 window.show();
 wdContext.currentRootElement().setpopupWindow(window);
}

Similarly create one more method in your component controller to hide the popup window.

public void hidePopup(){
    IWDWindow window =  wdContext.currentRootElement().getpopupWindow();
    window.hide();
}

Finally in your popup window view there should be some way to close the popup. Assuming it is a button "Close".

In the action handler for the button close call the hidePopup() method of the component controller.

//This is on the popup view controller
public void onActionCloseButtonClicked(){
//close popup window
wdThis.wdGetComponentController().hidePopup();
}

Hope this helps.

Regards,

Sanyev