Getting values from parent page
Getting values from parent page
- Subject: Getting values from parent page
- From: Florijan Stamenkovic <email@hidden>
- Date: Wed, 11 May 2005 15:10:06 +0200
Hi list..
I am trying to find a way for my PageWrapper full document component to
get a title for the page from it's parent component, which is a partial
doc.
My current idea (after reading some about it) is to bind the doc title
of the PageWrapper to a method that looks like this:
protected String pageName()
{
try{
return (String)context().page().valueForKey("pageName");
}
catch(Exception e){
return "Untitled document";
}
}
and then provide all my partial docs with a
final String pageName = "Whatever"
I had some other ideas, but they were for this or another reason just
not functional.
Is this a good approach to the issue? It seems fail-proof to me.I tried
to do it already with bindings on my partial pages like
ComponentContent: PageWrapper{
wrapperPageName = pageName; //where title is bound to wrapperPageName
in the full document PageWrapper
}
but that resulted in weird behavior. The String was passed and set on
the first run, so my page title did get the proper string (I was
setting different strings for wrapperPageName and pageName in their
constructors), but I was unable to change it dynamically. I bound the
pageName (parent component) key to a text field, put it in a form and
tried changing it while running the app. I could not. When I removed
the wrapperPageName = pageName binding, I could edit the String as I
pleased... Can't understand why.
TIA
Florijan
_______________________________________________
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