on 11-02-2007 1:13 PM
Hi
Experts
My code is
IWDWindowInfo windowInfo = (IWDWindowInfo)wdComponentAPI.getComponentInfo().findInWindows("AddressbookWindow");
// create the AddressbookWindow
IWDWindow window = wdComponentAPI.getWindowManager().createWindow(windowInfo,true);
// set the WindowPosition on the screen
window.setWindowPosition(300,150);
// and show the window
try{
wdContext.currentPopupElement().setWindowInstance(window);
}
catch(Exception E){
wdComponentAPI.getMessageManager().reportException(E.toString(),false);
}
window.open();
when trying to store window i am getting
java.lang.NullPointerException
error in catch.Please Help Me.
Sunny,
Check the name of the window. Its case sensitive.
Regards,
Rajit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Rajit & Murtuza.
there is already one element created in the PopupNode.
Structure of my context is
In context
one value node name is <b>Popup</b>
In this value node another value attribute <b>WindowInstance</b>.
type of it is com.sap.tc.webdynpro.services.session.api.IWDWindow.
Thanking you
Sunny.
Hi Sunny,
As you said that you have already instantiated an element of popup node so it should ideally not give an error.
But just to get a default element being provided by framework just change the cardinality of the popup node to 1:n instead of 0:n
Hope you added element to popup node like this:
IPrivate<viewname>.IPopupElement ele = wdContext.nodePopup().createPopupElement();
ele.setWindowInstance(<window instance>);
wdContext.nodePopup().addElement(ele);
Regards,
Murtuza
Hi kelly & murtuza
I just try and reply u.
At present what i do is i write window variable like
//@@begin others
IWDWindow window;
//@@end
Actually what happens is it finds the addressbook window from repository
but when coming back to original window it just display blank screen.
I make one mail window and one addressbook window.
If someone clink on addressbook on to option of mail window,
one small adressbook window get opend.
and when on adressbook window anyone click on button
it fires one event that is in component controller.
and i make it's event handler in the email window.
But problem is that at returning time it just give me blank screen.
Thanking you.
Sunny.
A general practice for building robust applications is to check the return values of methods that return null reference values before attempting to dereference. If the method returns null, it is much better practice to issue a warning rather than letting the application croak with a null pointer exception.
For example:
I
WDWindowInfo windowInfo = (IWDWindowInfo)wdComponentAPI.getComponentInfo().findInWindows("AddressbookWindow");
if (windowInfo == null) {
wdComponentAPI.getMessageManager().reportWarning("Failed to get window info for AddressbookWindow");
}
else { << dereference windowInfo, etc. >> }
The javadoc I have for findInWindows unfortunately does not document its return values but I would assume it returns null if the specified window is not found.
Also, if you would post the stack trace, or the top part of it, we could better help you.
Regards,
Kelly
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
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.