cancel
Showing results for 
Search instead for 
Did you mean: 

How to pass parameters to a view's init phase within a popup window

Former Member
0 Kudos

Hi expert,

I have this technical requirement as to Window, I dont know how to implement it:

I have a popup windows, the view of which is from other interface view, no external context mapping. So I want to pass initial parameter to this view, I am not willing to use context mapping, so I do Event.

Actually, with event I can pass the parameter to this view, BUT it happened after init, every first time this window popup with no parameter in properly, but after that parameter will be put in.

My question is how to put in a paramter into the init phase of the view, or is there anything I do wrong when fire the event?

Below is my code to popup the window:

String usercc = UserInfo.getCostCtr();

if (usercc != null && usercc.length() > 0) {

wdThis.wdGetCostCtrInterface().fireCCInitEvent(usercc); //HERE's the fire code.

IWDWindowInfo windowInfo =

(IWDWindowInfo) wdComponentAPI.getComponentInfo().findInWindows(

"CostCtrVS");

// create the dialog

window =

wdComponentAPI.getWindowManager().createModalWindow(windowInfo);

// set the WindowPosition on the screen

window.setWindowPosition(150, 150);

window.show();

//I ALSO TRIED HERE TO FIRE THE EVNET, BUT NO EFFORT

}

Thank you in advance,

William

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi William,

I had almost an identical problem to solve and here is what works for me:

<b>Code to open an external window which contains my view:</b>


String paramValue = "MyVal";
String appUrl = WDURLGenerator.getWorkloadBalancedApplicationURL(wdComponentAPI.getApplication().getDeployableObjectPart());

// append parameters
appUrl = appUrl.concat("?myParameter="+ paramValue);

// window creation
IWDWindow win = wdComponentAPI.getWindowManager().createNonModalExternalWindow(url,"MyWindow"); win.show();

Upon entering the opened window, which might contain a new view, you can fetch those parameters via:

<b>Fetch parameters from URL:</b>


String myParam = WDProtocolAdapter.getProtocolAdapter().getRequestParameter("myParameter");

The getRequestParameter(String) method is deprecated, but so far - I'm using NW2004s, EP SP 13 - I encountered no problems.

Hope I could help you.

regards,

Christian

Former Member
0 Kudos

Hi,

Use the following if you dont want depricated code.

IWDProtocolAdapter protocolAdapter = WDProtocolAdapter.getProtocolAdapter();

IWDRequest request = protocolAdapter.getRequestObject();

String paramValue = request.getParameter("key");

Regards

Ayyapparaj

Former Member
0 Kudos

Cool!!

Christian, Thank you for your reply which is definitely solve this problem.

Answers (0)