• 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: Repeating a component output in the same page
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Repeating a component output in the same page


  • Subject: Re: Repeating a component output in the same page
  • From: Chuck Hill <email@hidden>
  • Date: Wed, 9 Jan 2008 14:44:01 -0800


On Jan 9, 2008, at 2:15 PM, Andrew Lindesay wrote:

Hello Miguel;

The pager rendering is not a dramatic computational process, but it requires some queries to the database to know how much items to page, and in some situations some objects that are being paged. So, I would like to avoid doing that twice.

Of course, I can have solve this at the controller level, making sure that the calls are only executed once per RR loop, etc. But I'm thinking, this is WO, so there's probably a better way. And the better way would be to, of course, copy the rendered HTML of the pager to the second location of the page. I'm actually not sure if this a better way (my "elegance VS pragmatism" eternal philosophical questions) but anyway, how would this be done in WO? BTW this is supposed to work on AjaxUpdateContainers, so the solution would have to support that

Could you cache intermediate query results in the info dictionary of the generated response message?

If wonder if you did something like this:

private String renderedHTML;

public void appendToResponseInContext(WOResponse r, WOContext c) {
    if (renderedHTML != null) {
        r.appendContentString(renderedHTML);
        renderedHTML = null;
    } else {
	WOResponse componentResponse = new WOResponse()
        super.appendToResponseInContext(componentResponse, c);
	renderedHTML = componentResponse.contentString();
        r.appendContentString(renderedHTML);
    }
}


Chuck


--

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


  • Follow-Ups:
    • Re: Repeating a component output in the same page
      • From: Mike Schrag <email@hidden>
    • Re: Repeating a component output in the same page
      • From: Chuck Hill <email@hidden>
    • Re: Repeating a component output in the same page
      • From: Andrew Lindesay <email@hidden>
References: 
 >Repeating a component output in the same page (From: Miguel Arroz <email@hidden>)
 >Re: Repeating a component output in the same page (From: Andrew Lindesay <email@hidden>)

  • Prev by Date: Re: Can't retrieve cookies
  • Next by Date: Re: Repeating a component output in the same page
  • Previous by thread: Re: Repeating a component output in the same page
  • Next by thread: Re: Repeating a component output in the same page
  • Index(es):
    • Date
    • Thread