cancel
Showing results for 
Search instead for 
Did you mean: 

WorkProtect Mode

Former Member
0 Kudos

Hi All,

My requirement is to show a popup to save data before navigating away from a web dynpro Iview.

I understand this can be acheived using the WorkProtect Mode

Can anybody Pls guide me through on using Workprotect mode by steps and tell me of prerequisites if any.

FYI , my WDJ and Portal are on two different servers.

Many Thanks,

Ashok

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

You can also show a popup to save data before navigating away from a web dynpro Iview by using Confirmation dialog.

Use this code

First of all create two event handlers at methods tab named ok and cancel.



IWDControllerInfo cntrl_info = wdControllerAPI.getViewInfo().getViewController();
    IWDConfirmationDialog confirm = wdComponentAPI
    						.getWindowManager()
    						.createConfirmationWindow("You are going to Exit, Want to Proceed?",
    						cntrl_info.findInEventHandlers("cancel"),"Cancel");
	confirm.addChoice(cntrl_info.findInEventHandlers("ok"),"Confirm");
	confirm.setWindowSize(250,100);    													
        confirm.setWindowPosition(100,100);
    confirm.show();

On click of submit button u can use this code to open confirmation dialog and put navigation via plug out to another view under method of OK in implementation.

On click of submit it will submit your operation and then open this dialog box. On click of cancel it will remain on same view after closing dialog window. And on click of Confirm (OK) it will navigate to required view via plug out.

Mandeep Virk

PradeepBondla
Active Contributor
0 Kudos

HI Ashok,

Here are very good documents on work protect mode given step by step work

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/8382535d-0d01-0010-dbb5-d3d41dfe...

http://help.sap.com/saphelp_nw04s/helpdata/en/88/585d420447e054e10000000a155106/frameset.htm

settings for work protect mode http://help.sap.com/saphelp_nw04/helpdata/en/37/50fb5066f9db43b3b5d5fc8de0c051/frameset.htm

answered thread on Work Protect Mode /thread/344894 [original link is broken]

WorkProtect mode talks about how you wish to work with navigation of iViews inside Portal. Basically if you wish to navigate to some other iView, WorkProtect Mode deals with how you want to deal with data on the iView which is currently open. You have three options with you:

1)You can open the new iView in the same window, and any unsaved data in the previous iView is lost

2)You can open the new iView in a new window (pop-up), and the previous unsaved data remains as it is.

3)The third option is used to make the settings in such a way that a pop up opens, and you can select in that pop up what do you wish to do with the previous unsaved data.

I guess you want to know about this functionality. See you have a Standard User Role (eu_role). If this role is assigned to the user, then in portal he will have the Personalize link enabled in portal. Clicking on this Personalize link, he can set the WorkProtect Levels.

Now read under Customizing the WorkProtect Mode Behavior on Page 4 in the following doc:

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/8382535d-0d01-0010-dbb5-d3d41dfe...

Pradeep