• 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
NullPointerException
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NullPointerException


  • Subject: NullPointerException
  • From: Awbrey Hughlett <email@hidden>
  • Date: Tue, 30 Sep 2008 22:07:35 -0500

I have an entity named "Specific" and an attribute named "specificType". I have a WOTextField bound to specific.specificType and a WOSubmitButton bound to saveChanges() all wrapped in a WOForm. When I run the component and click to save changes to the database, I get a NullPointerException. Have I instantiated the Specific entity and inserted it into an editing context correctly? Or do I have other problems?

public class SpecificEntry extends WOComponent {
private Specific specific;
private EOEditingContext ec = new EOEditingContext();


    public SpecificEntry(WOContext context) {
        super(context);
    }

    

    public Specific specific() {
    if (specific == null) {
    editingContext().revert();

    

    specific = (Specific)EOUtilities.createAndInsertInstance(editingContext(), "Specific");
    }

    

    return specific;
    }

    

    public WOComponent saveChanges() {

    

    editingContext().saveChanges();

    

    setSpecific(null);

    

    return context().page();
    }

    

    public EOEditingContext editingContext() {
    return ec;
    }

    

    public void setSpecific(Specific newSpecific) {
    specific = newSpecific;
    }
}

Thanks,
Awbrey
 _______________________________________________
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

  • Follow-Ups:
    • Re: NullPointerException
      • From: Chuck Hill <email@hidden>
  • Prev by Date: Re: Wonder intro part 1
  • Next by Date: SQL Server 2005 Support Request 2
  • Previous by thread: Re: A little help generating dynamically the content of a div
  • Next by thread: Re: NullPointerException
  • Index(es):
    • Date
    • Thread