Or, what I have done sometimes is this:

@Override
public MESDriver object() {
        return = (MESDriver)valueForBinding("object");
}

If your object is never persisted in this component but instead is just always 
pulled from the binding, you don't have to worry about resetting the local 
variable. I know I've done this quite a bit but I've never asked if it is a 
reasonable pattern. :-)

Tim
UCLA GSE&IS 

On Jun 21, 2012, at 7:45 PM, Chuck Hill <[email protected]> wrote:

> sleep() for a normal component, reset() for a stateless one.
> 
> 
> On 2012-06-21, at 7:19 PM, Johnny Miller wrote:
> 
>> I'm missing a small piece of the puzzle.
>> 
>> If I use lazy initialization, when I attempt to bind a different object to 
>> the component it doesn't get set.
>> 
>> Therefore, where should I set the value of the variable to null?  In awake, 
>> sleep or reset?
>> 
>> Thank you,
>> 
>> Johnny Miller
>> Kahalawai Media Corp.
>> www.kahalawai.com
>> 
>> 
>> 
>> On Jun 21, 2012, at 1:49 PM, Chuck Hill wrote:
>> 
>>> For cases like this, and in fact for most cases, I turn OFF automatic 
>>> binding synchronization and do it in code.  I was just writing on that last 
>>> night for my optimization presentation.
>>> 
>>> 
>>> Chuck
>>> 
>>> 
>>> On 2012-06-21, at 4:44 PM, Johnny Miller wrote:
>>> 
>>>> So that's interesting (and something I didn't know about).
>>>> 
>>>> In the stack the current component, MESDriverEditor, gets called again and 
>>>> is asked pushValuesToParent.  Can I set that to false in my component 
>>>> action?
>>>> 
>>>> Johnny Miller
>>>> Kahalawai Media Corp.
>>>> www.kahalawai.com
>>>> 
>>>> 
>>>> 
>>>> On Jun 21, 2012, at 1:34 PM, Chuck Hill wrote:
>>>> 
>>>>> That is from some other component doing automatic binding 
>>>>> synchronization.  Look at the stack trace when it gets overwritten by the 
>>>>> current selected object
>>>>> 
>>>>> 
>>>>> On 2012-06-21, at 4:33 PM, Johnny Miller wrote:
>>>>> 
>>>>>> Hi Amedeo & Chuck,
>>>>>> 
>>>>>> This is what I've been trying. // updated since CH's email
>>>>>> 
>>>>>> public WOActionResults createNewDriverSchedule() {
>>>>>> 
>>>>>>  MESSchedule schedule = MESSchedule.createMESSchedule(ec());
>>>>>>  schedule.setDriverRelationship(MESDriver.localInstanceIn(ec(), 
>>>>>> object()));
>>>>>>  ((DispatchPagesWrapper)context().page()).setSelectedObject(schedule);
>>>>>>  return null;
>>>>>> 
>>>>>> }
>>>>>> 
>>>>>> If I put a logging statement on setSelectedObject I see that MESSchedule 
>>>>>> gets set but then it's gets overwritten by the current selected object?  
>>>>>> Do you know why that could happen?
>>>>>> 
>>>>>> Thanks a lot,
>>>>>> 
>>>>>> Johnny Miller
>>>>>> Kahalawai Media Corp.
>>>>>> www.kahalawai.com
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> On Jun 21, 2012, at 1:23 PM, Amedeo Mantica wrote:
>>>>>> 
>>>>>>> parent().parent().parent().... ?
>>>>>>> 
>>>>>>> Sent from my iPhone
>>>>>>> 
>>>>>>> On 22/giu/2012, at 01:16, Johnny Miller <[email protected]> wrote:
>>>>>>> 
>>>>>>>> Hi,
>>>>>>>> 
>>>>>>>> I'm trying to create a frame set behavior where in one column I have 
>>>>>>>> various navigation trees of EOs and in the other column I have a WO 
>>>>>>>> switch component that loads the correct editor depending on the type 
>>>>>>>> of EO that is selected from the navigation.
>>>>>>>> 
>>>>>>>> My question is it is possible for the component loaded by the switch 
>>>>>>>> component to communicate back up to the top component and set the EO 
>>>>>>>> that in turn will be loaded by the switch component?
>>>>>>>> 
>>>>>>>> Hope that makes sense,
>>>>>>>> 
>>>>>>>> Johnny Miller
>>>>>>>> Kahalawai Media Corp.
>>>>>>>> www.kahalawai.com
>>>>>>>> 
>>>>>>>> 
>>>>>>>> 
>>>>>>>> _______________________________________________
>>>>>>>> Do not post admin requests to the list. They will be ignored.
>>>>>>>> Webobjects-dev mailing list      ([email protected])
>>>>>>>> Help/Unsubscribe/Update your Subscription:
>>>>>>>> https://lists.apple.com/mailman/options/webobjects-dev/amedeomantica%40me.com
>>>>>>>> 
>>>>>>>> This email sent to [email protected]
>>>>>> 
>>>>> 
>>>>> -- 
>>>>> Chuck Hill             Senior Consultant / VP Development
>>>>> 
>>>>> 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/gvc/practical_webobjects
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>> 
>>> 
>>> -- 
>>> Chuck Hill             Senior Consultant / VP Development
>>> 
>>> 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/gvc/practical_webobjects
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>> 
> 
> -- 
> Chuck Hill             Senior Consultant / VP Development
> 
> 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/gvc/practical_webobjects
> 
> 
> 
> 
> 
> 
> 
> 
> 
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list      ([email protected])
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/webobjects-dev/lists%40thetimmy.com
> 
> This email sent to [email protected]

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to