• 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: Wrapping a component in another component programmatically
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Wrapping a component in another component programmatically


  • Subject: Re: Wrapping a component in another component programmatically
  • From: Ramsey Gurley <email@hidden>
  • Date: Mon, 02 Nov 2015 09:39:02 -0700

How about this,

WrapMe.html
<wo:switch componentName=“Wrapper” />

Wrapper.html
<wo:componentContent />

If you need to dynamically switch the wrapper, then componentName=“$wrapperName” instead. In this setup, WrapMe is the parent(), and Wrapper is the child component.

On Nov 2, 2015, at 5:46 AM, Hugi Thordarson <email@hidden> wrote:

> Hi all.
>
> I’m looking for a way to programmatically wrap one component instance into another one. Essentially: I want a switch component, but without putting an actual switch component into the child template itself.
>
> Pseudocodingally speaking, I want to be able to do something like this:
>
> public WOActionResults action() {
> 	WrapMe child = pageWithName( WrapMe.class );
> 	Wrapper parent = pageWithName( Wrapper.class );
>
> 	// somehow wrap ‘parent' around ‘child'…
> 	// ‘parent’ probably has a WOComponentContent in it where child should be inserted.
>
> 	return child;
> }
>
> I realize one approach is to go the other way around, i.e. by putting a switch component in “parent” and then communicating with my child component through bindings on that and returning “parent”. But I need to have the action method return the instance of the child component.
>
> Any ideas?
>
> 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: 
 >Wrapping a component in another component programmatically (From: Hugi Thordarson <email@hidden>)

  • Prev by Date: Re: More than the 2 default D2W rule files
  • Next by Date: Re: More than the 2 default D2W rule files
  • Previous by thread: Wrapping a component in another component programmatically
  • Next by thread: Re: Wrapping a component in another component programmatically
  • Index(es):
    • Date
    • Thread