on 01-20-2006 9:55 AM
I have a context Data. I need to display that data in a popup window(new window), as soon as i click a button in the view.
Can anyone help me in this issue
Hi Sreekar,
U can open a new popup window and display the data that is selected in one view to the other in the next window by creating a new window <b>Using the concept of event handling.</b>
<b><i>Just follow the steps:</i></b>
1) In the window --> right clik create a new window and embed a new view inside it.
2) In the <b>component controller</b> i) create a new event and a method.
ii) inside comp.ctrller implementation:
<b>newmtd()</b>
{
wdThis.wdFireEvent<event name>(parameter);
}
2) Get the value in the <b>1 view using the onACtion()</b> btn mtd:
<b>onAction()</b>
{
String x = wdcontext.currentContextelement.get<attname>;
}
3) For opening a new popup WD:
<b>onAction()</b>
{
String x = wdcontext.currentContextelement.get<attname>;
IWDWindowInfo window=wdComponentAPI.getComponentInfo().findInWindows("<second WD name>");
IWDWindow win=wdComponentAPI.getWindowManager().createWindow(window,false);
win.open();
wdThis.wdGet<component controller>().<comp ctrl mtd name>(x);
wdContext.currentContextElement().<b>setInstance</b>(win);
//instance is con.att of type IWDWindow in native directory.
}
4) Finally in the <b>second view</b> create method as event handler:
<b>In the event handler()</b>
{
wdContext.currentContextElement().set<attname>(parameter);
}
5) For closing the popup WD have btn in the <b>second view</b>int he <b>onaction()</b>
{
IWDWindow win=wdContext.currentContextElement().<b>getInstance</b>(); // this instance is the context att of type IWDwindow.This should be selected form the native type.THis instance should be created in the 1 view and also in the comp.controller.
win.close();
}
That should solve ur query.
Regards,
Nagarajan.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi
for closing the popup window
map win instance from view1 to cc and cc to popup view
public void onActionOK(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActionOK(ServerEvent)
IWDWindow w=wdContext.currentContextElement().getWin();
w.destroy();
//@@end
}
regards,
Arun
hai sreekar,
First create a new window and embed a new view in it.In that view create the textview in it.
Let u want to pass the value of the inputfield of view1 to popup window view. create the value attribute of type string in view1 , popup view and component controller .add the component controller in the properties of both the view. Map the value attribute from view1 to cc and cc to popup view.
IWDWindowInfo inf=wdComponentAPI.getComponentInfo().findInWindows("Confirmwin");
IWDWindow win= wdComponentAPI.getWindowManager().createModalWindow(inf);
wdContext.currentContextElement().setWin_inst(win);
win.open();
win.setWindowSize(380,250);
win.setWindowPosition(500,200);
attribute win_inst is of type type com.sap.tc.webdynpro.services.session.api.IWDWindow
let me know if it helps,
hope this helps,
Regards,
Arun
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
create a new window and create context for that map it... and find the window and create it as a extenal window ......link to document....
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/documents/a1-8-4/tutorial on creating dialog boxes.htm
Regards,
yashpal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sreekar,
The steps you need to do for bringing up a new window are:
1) Create the view to be shown inside the pop-up. Create the required UI elements and map the corresponding context values to the Component controller's context
2) Create a window and embedd this view in it.
3) Map the required attributes from the parent view to the component controller too.
4) In the action handler of the button, write the following lines of code:
IWDWindow window;
IWDWindowInfo winInfo = wdComponentAPI.getComponentInfo().findInWindows("<name of the created name>");
window = wdComponentAPI.getWindowManager().createModalWindow(winInfo);
wdContext.currentContextElement().setWindowInstance(window);
window.setWindowSize(600, 200);
window.setWindowPosition(WDWindowPos.CENTER);
window.open();
This will open up a modal window.
Hope this helps,
Best Regards,
Nibu.
Oooops I am sorry.....You already have got these answers !
Message was edited by: Nibu Wilson
User | Count |
---|---|
84 | |
25 | |
12 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.