• 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: Refreshing complete page from a header component
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Refreshing complete page from a header component


  • Subject: Re: Refreshing complete page from a header component
  • From: Chuck Hill <email@hidden>
  • Date: Fri, 29 Jun 2007 10:00:15 -0700


On Jun 29, 2007, at 6:39 AM, Steven Mark McCraw wrote:

Can anyone comment on the benefits of returning context().page() vs. returning null for an action method?

They both have the same effect (unless you are dong something funky / bad in your code but I will ignore that remote possibility).



Returning context().page() seems to not work when using Wonder Ajax components, so I always return null there.

That framework changes the RR loop so that it is a special case. Null is what to return there.



Someone who worked at Apple once told me that returning context ().page() was WAY more efficient.

Mike and I looked at this a while back. Returning context().page() is _slightly_ more efficient. Returning null is not ever going to be a performance bottleneck in your app. My personal preference is to return context().page() as it is very clear in what it is doing. The slight increase in efficiency is just a bonus.



I took them at their word and started using it everywhere, but it's come to be one of those things that I kind of doubt makes that big of a difference. Does anyone know what the difference actually is, and why one might be better than the other?

The difference is that returning context().page() stops the invokeAction processing immediately. Returning null results in the framework continuing to evaluate invokeAction looking for a non-null response. If nothing returns a non-null response, it returns context ().page() as the default action.


Chuck


On Jun 29, 2007, at 9:17 AM, Paul Lynch wrote:

On 29 Jun 2007, at 12:31, Johan Henselmans wrote:

I must be missing something: I have a header component, which contains the menubar, and sets the default language, by calling session.setlanguages() via a WOHyperlink. After that I want to return the current page. But a "return this" from within the Header WOComponent will only return the header. Any idea how to get the current page returned from within the header component?

This is the structure:

WOComponent->Page
	WOComponent->Header
	rest....
	WOComponent->Footer

Try:

return context().page();

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


This email sent to email@hidden


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


This email sent to email@hidden


--

Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects






_______________________________________________
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: 
 >Refreshing complete page from a header component (From: Johan Henselmans <email@hidden>)
 >Re: Refreshing complete page from a header component (From: Paul Lynch <email@hidden>)
 >Re: Refreshing complete page from a header component (From: Steven Mark McCraw <email@hidden>)

  • Prev by Date: Re: Refreshing complete page from a header component
  • Next by Date: Re: Finding binding in .wod file
  • Previous by thread: Re: Refreshing complete page from a header component
  • Next by thread: Re: Refreshing complete page from a header component
  • Index(es):
    • Date
    • Thread