on 04-17-2008 4:58 AM
Hi,
I want to open a window(a new browser page) on the click of a button.Can anyone please tell me what i should write in the onAction of the button?
Regards,
Padmalatha.K
Hi Padmalatha,
On the click of the Action button
IWDWindow window = wdComponentAPI.getWindowManager().createExternalWindow("URL Required","Title",boolean modal);
window.open();
Thanks,
Prasanna.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
1.Declare the following in the implementaion of the component controller
//@@begin others
IWDWindow modalWindow;
//@@end
2.First create a method in the component controller :
public void createExternalWindow( )
{
//@@begin createExternalWindow()
// create external window
IWDWindow externalWin = wdComponentAPI.getWindowManager().createNonModalExternalWindow
("http://www.google.co.in/", "External");
//Define window position and dimensions according to acreen parameters
externalWin.setTitle("Google");
externalWin.setWindowPosition(WDWindowPos.CENTER);
externalWin.setWindowSize(1280,850);
externalWin.show();
//@@end
}
3.Create a button in the view, create an action. assign this action to the button . Now call the method in the view controller.
public void onActionexternal(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActionexternal(ServerEvent)
wdThis.wdGetPopUpCompController().createExternalWindow();
//@@end
}
Now to create a modal window
1.Declare the following in the implementaion of the component controller
//@@begin others
IWDWindow modalWindow;
//@@end
2.Create a new window "NewPopWindow".Declare the following in the implementaion of the component controller.
public void createModalWindow( )
{
//@@begin createModalWindow()
//creating the window
IWDWindowInfo winInfo = wdComponentAPI.getComponentInfo().findInWindows("NewPopWindow");
modalWindow = wdComponentAPI.getWindowManager().createModalWindow(winInfo);
//display window in centre
modalWindow.setWindowPosition(WDWindowPos.CENTER);
modalWindow.setTitle("Modal Window");
modalWindow.setWindowSize(400,100);
//opening the window
modalWindow.show();
//@@end
}
3. destroy the window
public void destroyModalWindow( )
{
//@@begin destroyModalWindow()
modalWindow.destroyInstance();
//@@end
}
4.Create a button in the view, create an action. assign this action to the button . Now call the method in the view controller.
public void onActionmodal(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActionmodal(ServerEvent)
wdThis.wdGetPopUpCompController().createModalWindow();
//@@end
}
regards,
pinki
Edited by: pinki goswami on Apr 17, 2008 11:42 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
For this first we make a Window and Embedd the desired View in this window.
Now Make a method by which we can open the desired window.
Here the method is openWindow
And closeWindow.
(These methods are inside component controller)
Make a value attribute(windowInstance) inside component controller of type IWDWindow.
public void OpenWindow( ) {
IWDWindowManager winMgr= wdThis.wdGetAPI().getComponent().getWindowManager();
IWDWindowInfo winInfo=wdThis.wdGetAPI().getComponent().getComponentInfo().
findInWindows("FontFormatWindow");
IWDWindow changeFontWindow=winMgr.createModalWindow(winInfo);
changeFontWindow.setWindowPosition(WDWindowPos.CENTER);
changeFontWindow.setTitle("Change Font Format-Title");
changeFontWindow.show();
wdContext.currentContextElement.setwindowInstance(changeFontWindow);
//@@end
}
public void CloseWinDow( ) {
IWDWindow ins=wdContext.currentContextElement.getwindowInstance();
ins.destroyInstance();
}
Regards
Trilochan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
create one context attribute in component controller of type java native type(IWDWindow) and mapped it with main view where your button and window(here below code have that window name is popwin) that you want to open.
IWDWindowInfo windowInfo = (IWDWindowInfo)wdComponentAPI.getComponentInfo().findInWindows("Popwin");
// get information of window in controller context
IWDWindow window = wdComponentAPI.getWindowManager().createWindow(windowInfo,true);
window.setWindowPosition(WDWindowPos.CENTER);
window.open();
// store information of window in controller context
wdThis.wdGetAbhiappController().wdGetContext().
currentContextElement().setWin(window);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello padmalatha,
Dynpro allows to use 3 types of windows, and what you need is External Window.
IWDWindow window = wdComponentAPI.getWindowManager().createExternalWindow( "http://www.google.com", "Google", true);
window.open();
first argument is the URL path, second is title and the third determines the modal (Only the non-modal windows are currently supported - NWDS 7.0)
Regards
Vinod V
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
92 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
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.