• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
puzzle with weird action handler
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Prev by Date: About WWDC session...worth buying DVD sessions when available?
  • Next by Date: Re: Can't open .wo on after upgrading to Xcode 2.1
  • Previous by thread: Re: About WWDC session...worth buying DVD sessions when available?
  • Next by thread: Who got lucky?
  • Index(es):
    • Date
    • Thread