puzzle with weird action handler
puzzle with weird action handler
- Subject: puzzle with weird action handler
- From: Wolfram Stebel <email@hidden>
- Date: Tue, 14 Jun 2005 23:40:12 +0200
Hi all,
i have to methods to respond to an action. The first verifies the data of
it's parent and returns the parent component in case of error. (Types are
correct, dont mind!). This case works!
In case of no error it should construct a new page AdressPage, but it shows
an exception:
java.lang.NullPointerException
Application.java 114 pageWithName Application
WOComponent.java 1200 pageWithName com.webobjects.appserver
AddressSubComponent.java 57 allAddresses AddressSubComponent
...
many more
...
The second works correctly.
The main difference is the return type of the method and the early return on
"res" in the first method.
// public WOActionResults allAddresses()
// {
// WOActionResults res = this.performParentAction (
"validateEntityForSave" );
// if ( res != null )
// return res;
//
// AdressPage nextPage = null;
// if ( this.hasBinding ( "addressRelation" ) && this.hasBinding (
"relatedBuPa" ) )
// {
// nextPage = ( AdressPage ) pageWithName ( "AdressPage" );
// nextPage.setRelationAddresses ( ( NSArray )
this.valueForBinding ( "addressRelation" ) );
// nextPage.setRelatedBusinesPartner ( ( CBusinesPartner )
this.valueForBinding ( "relatedBuPa" ) );
// nextPage.setReturnPage ( parent().name(),
this.getReturnParameters () );
// }
// return nextPage;
// }
//
public AdressPage allAddresses()
{
AdressPage nextPage = null;
if ( this.hasBinding ( "addressRelation" ) && this.hasBinding (
"relatedBuPa" ) )
{
nextPage = ( AdressPage ) pageWithName ( "AdressPage" );
nextPage.setRelationAddresses ( ( NSArray ) this.valueForBinding
( "addressRelation" ) );
nextPage.setRelatedBusinesPartner ( ( CBusinesPartner )
this.valueForBinding ( "relatedBuPa" ) );
nextPage.setReturnPage ( parent().name(),
this.getReturnParameters () );
}
return nextPage;
}
Any ideas why this happens?
Wolfram
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden