• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Programmatic access to a componen instance generated by a switch component
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Programmatic access to a componen instance generated by a switch component (From: Hugi Thordarson <email@hidden>)

  • Prev by Date: Programmatic access to a componen instance generated by a switch component
  • Next by Date: Returning a response of unknown length using WOResponse.setContentStream()
  • Previous by thread: Programmatic access to a componen instance generated by a switch component
  • Next by thread: Returning a response of unknown length using WOResponse.setContentStream()
  • Index(es):
    • Date
    • Thread