on 06-14-2005 9:46 AM
Hi all,
I'd like to create a popup window to display messages to user...
Until now I got able to create and display it, but I miss some points:
-
I. how to close it ?
-
I've read thread *How do i get Window instance
1.In the (First)calling View write a eventHandler and place the following code in the eventHandler
IWDWindow window = wdContext.currentPopupElement().getWindowInstance();
window.destroy();
2. In the componentController write a eventHandler that will fire the above view event
Ex: wdThis.wdFireEventDestroySelectedEvent();
3. In the PopupView , place a button and in the action call the componentController event.
But I don't really understand the second point... What is my componentController ? Is it the component controller of my whole application ??? Or the controller of my view ??
It would be great if someone can clarify this to me...
I tried to make my popupview know about calling viewcontroller (wdThis.wdGetFirstWindowInterfaceViewController()), but it seems that I can't call any methods of it
Or at least, I don't know how to get my view controller from the above...
-
II. how to control it ?
-
There also I miss something...
I'd like to set some context values and to change the title of the window
Thanks in advance for any help !
Hi,
The (parent)main view and the pop up view will be common to a component. Inside the component you find controller called component controller.
1. Create a function say close in component controller.
2. Create a event say closeevent in component controller
fire this event in the function close
3. Add this controller in Properties-> Required controller of the pop up view.
4.Now in the parent view create a event handler<close eventhandle> and subscribe for the event in the component controller.
5. And call it on action of close button in tht pop up view.
say onActionclose(){
wdThis.wdGet<controller>.close();
}
Regards
Bharathwaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you very much for this step-by-step explanation ! It was exactly what I needed !!
Now it's working (at least the popup window gets closed when clicking OK. A small step for humanity but a huge to me ).
By the way, if anyone could give me some hints on how to pass values / context to popup window
Thank you very much !
Hi,
Create the attribute whose value has to placed in the parent view s context. Create the same in the controller context and map the parent context attribute to the controllers attribute.
Now in the pop up view.. create the same attribute and map it to the component controller context.
parentview context attr ->comp contr context attr -> pop up view context attr.
Now if the value is set in the parent or in the controller it will be available in the pop up view
Regards
Bharathwaj
Let the main view be MainView and the popup view be PopUpView and the comp controller be MainComp.
On press of the button in the PopUpView fire the event. Create a event handler in the mainview and subscribe the event fired from the Comp Controller and give the code you need to destroy the window instance.
Comp Controller is the one you have below the WebDynpro Components under the project
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think you have one component in your project.So i am referring to compoentController of your project not interface controller .
Regards, Anilkumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I forgot to tell: I create my popup window using the following:
IWDWindowInfo windowInfo =(IWDWindowInfo) wdComponentAPI.getComponentInfo().findInWindows("PopupMsgWindow");
IWDWindow window = wdThis.wdGetAPI().getComponent().getWindowManager().createWindow(windowInfo, true);
window.setWindowPosition(WDWindowPos.CENTER);
window.setWindowSize(200, 150);
window.open();
wdContext.currentContextElement().setPopUpWindow(window);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.