Re: Reusable Component - create action binding
Re: Reusable Component - create action binding
- Subject: Re: Reusable Component - create action binding
- From: Chuck Hill <email@hidden>
- Date: Thu, 10 Apr 2008 11:22:36 -0700
On Apr 10, 2008, at 11:15 AM, John Huss wrote:
I'm trying to create a reusable component that has an action binding
(that ends up being bound to a submit button).
The documentation here is helpful, but I'm wondering about this:
When using the child component, it shows the action binding as a
string:
Parent's Declarations File (excerpt)
ALERT: AlertPanel {
...
parentAction = "respondToAlert";
};
But I was expecting to a direct reference without the quotes, like:
parentAction = respondToAlert;
Actually, doing this works, but it causes the action method to be
invoked many times, whereas using the string it is only invoked once.
The java file for my child component has something like this:
public String parentAction;
public WOActionResults submitButtonAction() {
return performParentAction( parentAction );
}
So, how should I be doing this?
1. Turn binding synchronization off. With it on, the parentAction =
"respondToAlert" binding is the only thing that works.
2. Handle manual binding sync for the rest of the binding.
3. Bind the action as you normally would with WOHyperlink etc. I'd
usually use the ^ notation, and so something like
Save: WOSubmitButton {
action = ^action;
}
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