Re: WOComponent Function Call Order
Re: WOComponent Function Call Order
- Subject: Re: WOComponent Function Call Order
- From: Alexander Spohr <email@hidden>
- Date: Mon, 10 Dec 2012 20:01:41 +0100
WO runs from to to bottom of your page. So it should work.
A better way would be to do the calculations in appendToResponse() before you call super. Then all will be set before the page is rendered.
If you can not do that because of your loop, you could do it in the displayedObjects call. Or in a method that calls displayedObjects and returns after your calculation for this item.
atze
Am 10.12.2012 um 19:41 schrieb Louis-Olivier Roof <email@hidden>:
> Hello WebObjects community, this is my first question so don't be too hard on me ;)
>
> Lets say I have a wo:loop in a component...
>
> <wo:loop list = "$dg.displayedObjects" item = "$aItem">
> <tr>
> <td> <wo:string value = "$~timeConsumingCallA()" /> </td>
> <td> <wo:string value = "$~timeConsumingCallB()" /> </td>
> <td> <wo:string value = "$~callDependingOn_A_and_B()" /> </td>
> </tr>
> </wo:loop>
>
> • Functions timeConsumingCallA() and timeConsumingCallB() are, as their name imply, costly calls.
> • Function callDependingOn_A_and_B() depends on the results of the two first functions.
>
> Is there any guarantee that the two function calls (timeConsumingCallA, timeConsumingCallB) will always be called in order and before callDependingOn_A_and_B() so I can set and depend on instance variables $timeConsumingCallA_result and $timeConsumingCallB_result in the callDependingOn_A_and_B() function?
>
> If not, I can see a number of ways I could myself make sure the calls are made in the correct order in straight-Java, but I was wondering if there was a "Wonder/WebObjects" strategy to approach this.
>
> Thanks for your time,
_______________________________________________
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