on 2007 Jul 13 7:30 PM
Hi all
I have implementated a search method that open ups a new window.
IWDWindowInfo windowinfo =
wdComponentAPI.getComponentInfo().findInWindows("Search");
IWDWindow window =
wdComponentAPI.getWindowManager().createModalWindow(windowinfo);
window.setWindowPosition(150, 100);
window.show();
wdContext.currentPopUpElement().setWindowInstance(window);
Now i want to make it generic so that same window opens up on every search but the data in it varies depending on the parameter passed.
In the above code no parameter is specified that should go into the new window (As per my requirement). Is there any way to pass the parameter into the new window so that the data in that popup window can be changed depending on that parameter.
Guys please response.
This is really urgent.
Thanxs in Advance
Thanks Roy,
I have followed this approach..its wrking.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Roy,
I have followed this approach..its wrking.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Gurmat,
Follow the steps.
Step1: Create a WD Component.
Step2: Under Component Controller create a Value Node EmployeeInfo with attribute EmployeeName and Position and a context attribute WindowInstance of type com.sap.tc.webdynpro.services.session.api.IWDWindow
Step3: Create 2 Views
i>EmployeeView
Layout like
-
Employee Name : EmployeeInfo.EmployeeName(InputField)
Employee Position : EmployeeInfo.Position(InputField)
DisplayResultButton
ii>DisplayView
Layout like
-
Employee Name : EmployeeInfo.EmployeeName(TextView)
Employee Position : EmployeeInfo.Position(TextView)
CloseWindowButton
Step3: Create 2 Windows
1>EmployeeWindow
2>DisplayWindow.
Under EmployeeWindow add the EmployeeView
and DisplayWindow add the DisplayView
Step3: Go to the Diagram View. Do the mapping between EmployeeView and Component Controller and between DisplayView and Component Controller
Step4: Associate action DisplayResult with the DisplayResultButton and use this code inside the Implementation of EmployeeView
public void wdDoInit()
{
//@@begin wdDoInit()
wdContext.nodeEmployeeInfo().addElement(wdContext.createEmployeeInfoElement());
//@@end
}
public void onActionDisplayResult(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActionDisplayResult(ServerEvent)
IPrivateEmploeeView.IEmployeeInfoElement emp = wdContext.createEmployeeInfoElement();
emp.setEmployeeName(wdContext.currentEmployeeInfoElement().getEmployeeName());
emp.setPosition(wdContext.currentEmployeeInfoElement().getPosition());
wdContext.nodeEmployeeInfo().addElement(emp);
IWDWindowInfo windowInfo =(IWDWindowInfo) wdComponentAPI.getComponentInfo().findInWindows(
"DisplayWindow");
// create the Window
IWDWindow window = wdComponentAPI.getWindowManager().createWindow(windowInfo, true);
window.setWindowPosition(WDWindowPos.CENTER);
window.setTitle("WindowTitle");
window.setWindowSize(100,100);
// Save WindowInstance in Context
wdContext.currentContextElement().setWindowInstance(window);
// and show the window
window.show();
//wdThis.wdFirePlugInDisplay();
//@@end
}
Step5: Associate action CloseWindow with the CloseWindowButton
and use this code inside implementation of DisplayView
public void onActionCloseWindow(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActionCloseWindow(ServerEvent)
IWDWindow window = wdContext.currentContextElement().getWindowInstance();
window.destroyInstance();
//@@end
}
Regards,
Mithu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Do you need any more help on this?
If yes, let us know what.
If no, please award points and close the thread.
Rgds,
Roy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
The Window is tied up to a component.
You can create a context element at the component and map it to both the view which called this window and the view that this window presents.
Than, before you call this window set the parameter value in view which calls this window and pick it up in the 2nd view in it's Init() method.
Hope it helps,
Roy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
70 | |
10 | |
10 | |
7 | |
6 | |
6 | |
6 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.