on 10-18-2009 7:29 PM
Hi Guys,
How to open a new View of a same application in a new window (just like a pop up) on a click of a Table Row entry?
I am using NWDS 7.0 version. So please suggest acccorrdingly.
Hi Nikesh,
first of all you will have to declare use of onLeadSelect event handler for your table (note that it will only be triggered when a lead selection occurs not a multiselection).
Also, you can build at design time a View and a Window (for example, PopupWin) in your WebDynpro Component, and embed the view into the window.
In your code for onLeadSelect function, you can use something like this to pop up the window.
public void onActionRowSelection(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActionSeleccionTabla(ServerEvent)
IWDWindowManager windowManager = wdComponentAPI.getWindowManager();
IWDWindowInfo windowInfo = wdComponentAPI.getComponentInfo().findInWindows("PopupWin");
IWDWindow window = windowManager.createModalWindow(windowInfo);
window.setWindowPosition(WDWindowPos.CENTER);
window.setWindowSize(new WDCssSize(450, WDWindowUnitOfLength.PX) , WDCssSize.UNDEFINED);
// Store handle ti window in context attribute to able to close it later
wdContext.currentContextElement().setPopup(window);
window.show();
//@@end
}
Hope it helps,
David
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi David,
It seems your code is working fine. But I have not added your last line of code . i.e. wdContext.currentContextElement().setPopup(window);
Please tell me what exactly is this Popup attribut's type and what it does?
After running your code, without the last line, the new popup window is getting opened. Now, some questions:
1. How to close this pop up window?
2. How to go back to last view, and click on another row item?
3. Actually, user shouldn't be able to go back to previous view, unless and until it closes the pop up window and/or Print this pdf. (My new window is a pdf document i.e. smart form)
The type of attribute "popup" should be (Java native type) IWDWindow. Create this attribute in the component controller and create a context mapping from the view controller V1 that opens the popup window and from the view controller V2 that is embedded in the popup window. In V2, add an action "ClosePopup" that hides or destroys the popup window. This action could be assigned to a "Close" button inside view V2.
Armin
Add an additional table column with cell editor = LinkToAction. Create an event parameter mapping to identify the table row. To do that, map the implicit event parameter "nodeElement" to an action parameter of type IWDNodeElement or I<Node>Element, where <Node> is the data source node of the table.
The code to open a modal popup window has already been given.
Armin
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.