Re: Programmatic access to a componen instance generated by a switch component
Re: Programmatic access to a componen instance generated by a switch component
- Subject: Re: Programmatic access to a componen instance generated by a switch component
- From: George Domurot <email@hidden>
- Date: Wed, 27 Mar 2019 15:48:07 -0700
Hi Hugi,
You can always you the trusty delegation pattern:
SomeComponentThatContainsAWOSwitchComponent nextPage = pageWithName(
SomeComponentThatContainsAWOSwitchComponent.class );
nextPage.setSomeComponentThatContainsAWOSwitchComponentDelegate(this);
nextPage.componentInstanceDisplayedByWOSwitchComponentSomehowExposed.searchString
= "Some String";
nextPage.componentInstanceDisplayedByWOSwitchComponentSomehowExposed.invokeSomeMethodThatPotentiallyModifiesTheResponse();
return nextPage;
Design your interface/delegate, and then implement on what/where/how care to
know/listen/control:
public interface SomeComponentThatContainsAWOSwitchComponentDelegate{
public String
someComponentThatContainsAWOSwitchComponentDelegate_searchString();
public WOActionResults
someComponentThatContainsAWOSwitchComponentDelegate_responseForDidCancel();
public WOActionResults
someComponentThatContainsAWOSwitchComponentDelegate_responseForDidSearch();
}
-G
> On Mar 27, 2019, at 8:34 AM, Hugi Thordarson <email@hidden> wrote:
>
> Hi all.
> I think I might be out of luck here, but does anyone have Some Amazing Way™
> to programmatically work with a component instance generated by a
> WOSwichComponent?
>
> Ideally, what I'd be able to do is something like:
>
> SomeComponentThatContainsAWOSwitchComponent nextPage = pageWithName(
> SomeComponentThatContainsAWOSwitchComponent.class );
> nextPage.componentInstanceDisplayedByWOSwitchComponentSomehowExposed.searchString
> = "Some String";
> nextPage.componentInstanceDisplayedByWOSwitchComponentSomehowExposed.invokeSomeMethodThatPotentiallyModifiesTheResponse();
> return nextPage;
>
> I'm currently using ERXThreadStorage to throw values around and facilitate
> communication between components, but of course that feels very, very wrong,
> so any suggestions would be nice.
>
> Cheers,
> - hugi
> _______________________________________________
> 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