One additional FYI. Be careful not to place your reusable component
inside a form on the parent component or you'll end up with nested
forms, which may produce some really strange behavior.
On Mar 27, 2007, at 10:12 AM, WIESEN Bruno wrote:
Re all,
Thank you, it works with performParentAction method !
Bruno
Bruno
Le 27 mars 07 à 16:00, Robert Walker a écrit :
Bruno,
Your subject line and your description seem to be a bit unclear.
From your subject line it sounds like you are trying to build a
reusable component containing a form with submit button for use
inside other components (a parent component). And you wish to
call an action of the parent component from the child.
---------------------------------------------------------------------
-----------------------------------------------
If I misunderstood you question please feel free to ignore the
rest of this post.
---------------------------------------------------------------------
-----------------------------------------------
I'm assuming you already know how to connect a WOSubmit button to
an action method of the component's java class. So this is why
I'm assuming that you are interested in connecting the submit
button to an action contained within the "parent" component.
This is possible by using performParentAction() with a binding
that will call the parent action by name (i.e. a selector
string). This can be tricky to understand the first time you do it.
If this is the case see the API documentation for WOComponent's
performParentAction() method. It explains what you need to do.
Look at the bindings carefully. Take note of the binding to
callback as shown here:
PALETTE: Palette {
selection = number;
callBack = "displaySelection";
};
Notice that "displaySelection" is just a String. It is not bound
to an actual method, but rather a String containing the "name" of
the method in the parent component you wish to call.
Now the action in the child component:
public WOActionResults click() { // this is the child's action
selection = "xxxx"; // some value
// now invoke the parent's action
return performParentAction(callBack);
}
Will activate the binding that you setup. Again the method will
be found in the parent component by the name given in callback.
On Mar 27, 2007, at 4:20 AM, WIESEN Bruno wrote:
Hello,
I've created a component which contents a WOForm and a
WOSubmitButton.
I want to add a binding to my custom component which is a method
(in order to give it to the "action" binding of WOSubmitButton).
Can someone help me with this?
Is there a tip to do this?
Thank you.
Bruno
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/
robertwalker1%40mac.com
This email sent to [EMAIL PROTECTED]
--
Robert Walker
[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:
http://lists.apple.com/mailman/options/webobjects-dev/dev%
40pyramide-ingenierie.be
This email sent to [EMAIL PROTECTED]
--
Robert Walker
[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:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com
This email sent to [email protected]