• 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: parent component content modification
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: parent component content modification


  • Subject: Re: parent component content modification
  • From: Jean-Francois Veillette <email@hidden>
  • Date: Thu, 28 Oct 2010 14:33:53 -0400

Le 2010-10-28 à 14:21, Michael Gargano a écrit :

> if i have a page template component...
>
> <html>
> <head>
> <webobject name="headStuff"/>
> </head>
> <body>
> <webobject name="pageContent"/>
> </body>
> <webobject name="endScript"/>
> </html>
>
> in my wod...
>
> endScript : WOJavaScript {
> }
>
>
> is there a way in a sub-compoent (that would provide the body content) to change the properties of that endScript component?  maybe sometimes i want to reference external src, other times i may want to have script between the <script></script> tags, other pages may do nothing with it, but i want it as a placeholder in my template.  is this possible?

yes ... here is a way ...

in your parent page, have something like:
String _appendToEndScript = "";
public void addToEndScript(String stuff) { _appendToEndScript += stuff; }
public String appendToEndScript() { return _appendToEndScript; }

in the parent page, have something like:
	endScript : WOJavaScript {
		value = appendToEndScript; // not sure about that binding, check the wojavascript api
	}
or
<script><wo:str value="$appendToEndScript" /></script>

Then down the tree, you call;
	frameworkComponent.appendToEndScript("alert('hi');");
where frameworkComponent is that component, either by frameworkComponent=parent(); or frameworkComponent=context().page(); or by binding frameworkComponent=this;

jfv


 _______________________________________________
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: 
 >parent component content modification (From: Michael Gargano <email@hidden>)

  • Prev by Date: EGWrapper and hyperlinks
  • Next by Date: Re: parent component content modification
  • Previous by thread: parent component content modification
  • Next by thread: Re: parent component content modification
  • Index(es):
    • Date
    • Thread