Re: Binding Synchronisation
Re: Binding Synchronisation
- Subject: Re: Binding Synchronisation
- From: Kieran Kelleher <email@hidden>
- Date: Mon, 28 Feb 2005 17:18:20 -0500
David,
I hope this helps.....
Have a look at WOComponent API valueForBinding and setValueForBinding
methods. In your subcomponent, you can define the API (jigsaw icon in
WOBuilder. Use lazy initialization to pull bindings on demand.
Subcomponents in general pull from parent and push into parent through
bindings. Here is an example of a simple manual pull and push of a
'customer' binding:
public CTCustomer customer()
{
if (customer == null) {
customer = (CTCustomer)valueForBinding("customer");
}
return customer;
}
public void setCustomer(CTCustomer newCustomer)
{
customer = newCustomer;
setValueForBinding(customer,"customer");
}
Also look at synchronizeVariablesWithBindings to turn on manual binding
synchronization (recommended to synchronize on demand rather than 6
times or so through the R-R loop)
Regards, Kieran
On Feb 28, 2005, at 3:42 PM, David Griffith wrote:
Hi all,
Can someone point me to a good tutorial on binding synchronisation? I
have a subcomponent in which I want to set a value from the parent to
the child. That is no problem. However I want to also set a value from
child to parent (which I have managed before under different
circumstances). However, I would like to get a complete overview of
exactly how binding sync works and it’s not explained in much detail
anywhere I have seen it so far.
Basically what I am doing is this:
I have products, each of which has a category.
I want the category selector subcomponent to receive a value from the
parent (this will be a category, for example one that cannot be
selected from the category selector because it is the current category
or something like that). Then, when the user clicks a category in the
subcomponent, I want it to be able to set that back to the parent.
However, the user can also selected the category from a list in the
parent if they wish. My problem is really with where and when and how
the bindings are set between parent and child and how to properly
control it in a manual scenario. I have spent a lot of time on it but
still don’t fully understand it.
Any help would be really appreciated,
Kind regards,
David. _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
email@hidden
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:
This email sent to email@hidden