Re: Binding Sync Question
Re: Binding Sync Question
- Subject: Re: Binding Sync Question
- From: Jonathan Rochkind <email@hidden>
- Date: Thu, 02 Jan 2003 14:00:35 -0600
Well, first, synchronizesVariablesWithBindings is true by default. So
explicitly setting it to true changes nothing. You _could_ explicitly set
it to false, at which point you would need to get and set the bindings
yourself in code (this is not really too hard though---if you end up
needing precise control over the timing and occurance of binding
synchronization, it's the only way to go).
But either way, I'm not sure binding values are going to be accessible at
constructor time. You could _try_ over-riding
synchronizesVariablesWithBindings to false, and then calling
valueForBinding("bindingName") in the constructor, to see if bindings are
even theoretically available at constructor time. If you go this route
though, you'll need to explicitly load the values of _all_ your bindings
using valueForBinding, it won't be done for you.
But do you really need it at constructor time? That seems unlikely. What
are you doing at constructor time that requires this binding, and why can't
you do it at a later point? Perhaps in appendToResponse before calling
super. Or else in a "lazy loading" accessor method. I can't think of
anything that you really do need to do at constructor time.
At 04:42 PM 1/2/2003 +1100, Brendon Allen wrote:
I have a component that I am loading in a page. This component consists of
a pop-up list I create dynamically. To make this code reusable I want to
pass the selection field as a binding form the page that calls my component.
It all sounds easy and I figured it would be but here is the problem I am
finding. The binding is not set at construct time. Hence when I try and
get the binding values when the constructor for my component gets called
they are null. Now if I add a hyperlink that calls a method in the
component to print out the bindings after construction with I click on the
link all the values are there!
I really need the values from the bindings at construct time, is there an
easy way to do this? I have tried explicitly setting the
synchronizesVariablesWithBindings() setting to true to no avail.
This question seems so simple but I cannot get the values when I need them,
thanks for your help.
Brendon Allen
_______________________________________________
WebObjects-dev mailing list
email@hidden
http://www.omnigroup.com/mailman/listinfo/webobjects-dev
_______________________________________________
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.