• 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: can I use fetch spec to filter an array?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: can I use fetch spec to filter an array?


  • Subject: Re: can I use fetch spec to filter an array?
  • From: Chuck Hill <email@hidden>
  • Date: Thu, 01 Jan 2004 11:16:44 -0800

Hi Denis,
At 03:03 PM 01/01/2004 +1300, Denis Stanton wrote:

>I never understood how returning null created the page.  It now seems
>to me that returning null amounts to "keep looking for something to do,
>and if you don't find it just repeat this page"
>
Yes, that is pretty much exactly it.  I have no idea why 'null' was
documented as the preferred return value.  I think the code that does this
is roughly

while (there are more elements and resultPage == null) {
    nextPage = elements.nextElement().invokeAction(aRequest, aContext);
}

If (nextPage == null) {
    nextPage = aContext().page();
}


Chuck

[discussing how WO finds the component that is the target of an action
binding]

>>> This seems like a very bad thing.  I click the submit button in a
>>> little query form at the top of the page and WO has to re-expand the
>>> whole rest of the page before it can figure out that the submit button
>>> was clicked?
>>>
>> No, just until it finds what was clicked.  This is why it is a bad
>> idea to return null from action methods: WO keeps looking for the
>> component responsible for the action.  With the query form at the top
>> it should stop fairly quickly.  If you put the form inside a table or
>> at the bottom of the page it can be a different story.
>
>That's odd.  The submit button is in a form at the top of the page.
>After that there is a repetition that works through the agent list, but
>there are no further active elements.  Repeated (and pointless) calls
>to setAgent are made before it finds and executes the action method
>bound to the submit button
>
>>> This page has no links from inside the repetition.  There
>>> seems to be no reason to re-expand the page.
>>>
>> It is just doing a tree traversal until it finds the correct action.
>> If your action method has
>> return null;
>> that is the cause.  Do this instead:
>> return context().page();
>
>OK, that worked.  Why is return null the standard (default) response?
>I never understood how returning null created the page.  It now seems
>to me that returning null amounts to "keep looking for something to do,
>and if you don't find it just repeat this page"
>
>Denis Stanton
>email@hidden
>Home:  +64 9 533 0391
>mobile: +64 21 1433622
>
>

--

Chuck Hill                                 email@hidden
Global Village Consulting Inc.             http://www.global-village.net
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: subclassing WODisplayGroup
  • Next by Date: Re: can I use fetch spec to filter an array? - WAIT I go ir
  • Previous by thread: Re: subclassing WODisplayGroup
  • Next by thread: Re: can I use fetch spec to filter an array? - WAIT I go ir
  • Index(es):
    • Date
    • Thread