Re: Passing WOActionResult to Custom Component
Re: Passing WOActionResult to Custom Component
- Subject: Re: Passing WOActionResult to Custom Component
- From: Bastian Triller <email@hidden>
- Date: Wed, 24 Oct 2012 16:36:07 +0200
did you override synchronizesVariablesWithBindings in MyComponent, so
that it returns false?
That prevents the action to get fired while rendering MyComponent. You
cann then bind the action to the SubmitButton in MyComponent with
^actionBindingName in the parent component of MyComponent.
See CCSmartAjaxButton or similar.
Am Mittwoch, den 24.10.2012, 16:14 +0200 schrieb Daniele Corti:
> Hi,
> probably is a simple thing, but I'm not able to create a custom
> component that allow to pass a WOActionResult and fire it when the
> user click on a button displayed by the component.
>
>
> I mean, I wanted to create a Component that show a Modal Container
> that allow the user to confirm an action. Like:
>
>
> MyComponent.wo:
> <wo:AjaxModalDialog label = "$linkLabel" locked = "$true" overlayClose
> = "$false">
> <wo:WOForm>
> <p>
> <wo:WOString value="$confirmMessage"></wo:WOString>
> </p>
> <p>
> <wo:WOSubmitButton action = "$actionToPerform" value
> ="$continueValue"></wo:WOSubmitButton>
> <wo:WOGenericElement elementName = "input" type = "button"
> value ="$cancelValue" onclick =
> "Modalbox.hide();"></wo:WOGenericElement>
> </p>
> </wo:WOForm>
> </wo:AjaxModalDialog>
>
>
>
>
> the problem is when I call
>
>
> <wo:MyComponent action = "$myAction" linkLabel = "Delete"
> confirmMessage = "Confirm Delete" continueValue = "Continue"
> cancelValue = "Cancel" />
>
>
> How can I handle the passed WOActionResult in the action bind to fire
> it when the user press the SubmitButton?
>
>
> I've notice that I cannot add a "public WOActionResult action;"
> attribute to the MyComponent.java class and point the WOSubmitButton
> action to it (I mean <wo:WOSubmitButton action = "$action" />) , or
> the WOActionResult is fired when the component is rendered.
>
>
> I think that I have to subclass the ERXDynamicElement in order to do
> this, but I've not found any example in the WOCommunity Wiki about how
> it works.
>
>
> Thanks in advance for any help!
> _______________________________________________
> 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
_______________________________________________
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