• 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
Re: deprecated API
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: deprecated API


  • Subject: Re: deprecated API
  • From: "Jerry W. Walker" <email@hidden>
  • Date: Thu, 9 Feb 2006 14:49:48 -0500

Hi, Zac,

WOComponents are usually instantiated by another component using WOComponent.pageWithName("<newComponentName>");

You can probably override the method

     public WOComponent(WOContext aContext)

but see the API documentation on this.

The biggest gotcha for WOComponents is initialization from another component. The code from the creating component tends to be something like this:

     public WOComponent someActionMethod()
     {
          // some processing...

          MyNewPage nextPage =  pageWithName("MyNewPage");     // 1
          nextPage.takeValueForKey(aValue, "someKeyName");         // 3
          nextPage.takeValueForKey(aValue, "someOtherKeyName"); // 4
          return nextPage;         // 5
     }

The code for the created component might look like this:

    public MyNewPage(WOContext context) {
        super(context);   // 2
    }

	public void appendToResponse(WOResponse r, WOContext c)
	{
		String saveThings1 = someKeyName;           // 6
		String saveThings2 = someOtherKeyName;   // 7
		super.appendToResponse(r, c);            // 8
	}



The gotcha is that the variables in the new page will not be available or set when the page is first created. The order of execution of the above statements is indicated by the commented numbers at the end of the lines.

To find out why this is, see the documentation for the following:

* http://developer.apple.com/documentation/WebObjects/ Web_Applications/Articles/1_Architecture.html#//apple_ref/doc/uid/ TP40003268-SW10

  * WOComponent

  * WOComponent methods:

     + appendToResponse

     + takeValuesFromRequest

     + invokeAction

     + awake

     + sleep

Regards,
Jerry

On Feb 9, 2006, at 2:20 PM, zac wrote:

I'm an old java hack who is picking up webobjects. When I try to overload a component's default constructor I get build warnings about overloading a deprecated api. I'm wondering what the best practices policy is for initializing components with more than one set of parameters.

Thx,

Zac
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40gmail.com


This email sent to email@hidden


--
__ Jerry W. Walker,
WebObjects Developer/Instructor for High Performance Industrial Strength Internet Enabled Systems


    email@hidden
    203 278-4085        office



_______________________________________________
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


References: 
 >deprecated API (From: zac <email@hidden>)

  • Prev by Date: Re: deprecated API
  • Next by Date: Re: deprecated API
  • Previous by thread: Re: deprecated API
  • Next by thread: Web Services, documented-style messaging
  • Index(es):
    • Date
    • Thread