Re: passing data to wrapper component
Re: passing data to wrapper component
- Subject: Re: passing data to wrapper component
- From: Sam Barnum <email@hidden>
- Date: Tue, 17 Aug 2004 19:49:17 -0700
Good advice, Dirk. Just to flush in the 'read the apple docs' part:
Your pagewrapper should probably be stateless. Override isStateless()
and return true.
This also turns off variable synchronization. You will need to access
bindings programatically, the will not be autopopulated or
synchronized.
Add a binding called 'title' to the API inspector.
A handy shortcut to use the value of a binding directly in a component
is to use a special syntax to refer to the value of a binding. THis is
the carat symbol, followed by the binding name.
So for the title of the page, add this:
<html>
<head>
<title><WEBOBJECT NAME=titleString></WEBOBJECT></title>
</head>
and define the value of the string as ^title
alternately, you could set the value of the string to title (without
the carat) and provide the following accessor in your pagewrapper:
public String getTitle() {
return (String)valueForBinding("title");
}
Once you get bindings figured out you can do some really nifty reusable
components.
On Aug 17, 2004, at 5:21 PM, Dirk Bajohr wrote:
Open up your wrapper component in WOBuilder and go to "Window"->"API".
There you can set bindings e.g. for your title. Create the appropriate
variables in the Java class (either manually or in WOBuilder, don't
forget to create a public setter).
Then open up the component that uses the wrapper. Select the wrapper
component and click the "Info" button. In the popup window you can see
and edit the title binding.
Another way is to use nonsynchronizing variables. See the Apple docs
for more infos.
Cheers,
Dirk
Am 18.08.2004 um 01:22 schrieb William Norris:
as per suggestions in various apple documents, I've created a
"pageWrapper" component that loads my basic header and footer for all
of my pages. However, sometimes I want to customize part of the
header for a particular page... perhaps include an additional
stylesheet, or change the page title. I know I can setup variables
for these in the pageWrapper component, but how do i then edit those
variables from the including components? The pageWrapper component is
not explicitly instantiated, so I'm not really sure how to reference
it.
thanks,
will
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.
--
Dirk Bajohr
iSOLUTION - Individuelle Software fuer moderne Kommunikation
Hauptstr. 50
53757 Sankt Augustin
T +49 2241 921567-0
F +49 2241 921567-89
http://www.isolution.de
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.