Re: Components on a page question...
Re: Components on a page question...
- Subject: Re: Components on a page question...
- From: James Cicenia <email@hidden>
- Date: Mon, 29 Mar 2004 15:39:06 -0600
Jonathan -
These days I am working 10-12 hours a day every day.
Anyway... it turned out that my problem was stupid... my submit button
was
the only thing wrapped in the form.
However, it has made me rethink my work... I have always subclassed my
pages from a the master Page and had put all my code in there. But now
you have me thinking that that would be inefficient just keeping the
code within
the children only.. Well,, deadlines are looming so re-factoring will
have to be
done for version 1.1.
-James Cicenia
On Mar 29, 2004, at 10:51 AM, Jonathan Rochkind wrote:
At 10:05 AM -0600 3/27/04, James Cicenia wrote:
Hello -
I have a WebObjects page that I built with multiple components
so that WOBuilder would have an easier time.
Say I have a Page with 3 components nested in it..
Page
Page1
Page2
Page3
I subclassed Page1, Page2, Page3 from Page.
Okay, to begin with this is an unusual design.
All my objects, initializations
are in Page. When it builds the page will Page1,2&3 void out my
objects?
You're getting confused. Page1, Page2, Page3 and Page are all distinct
seperate objects. The fact that all the subcompobnents subclass Page
doesn't change anything; you still have four different objects here.
They do not share any state. Each has it's own copies of all iVars.
If you want these components to share state, you need to pass objects
from Page into the sub-components via bindings. And it probably isn't
neccesary and is probably not a good idea to have these subcomponents
sub-class the Page class---at least if the only reason you were doing
that was to try and get them to share state, which that won't
accomplish anyway.
If you already do have bindings, let us know what they are. The
bindings could be implicated in your values changing when you don't
expect them to also. The default WO framework method of binding
synchronization sends values _both_ from parent to child _and_ back
out from child to parent. If the child changes the value of a variable
that has the same name as a binding, this value may be sent back out
to the parent, replacing the parent's original value. If that's
what's going on and it's undesirable, the solution is usually handling
binding value setting and getting yourself, instead of letting the
framework do it for you. See the synchronizesVariablesWithBindings
method.
Forgive me if I'm misunderstanding your question or your perspective.
I hope this helps.
--Jonathan
It seems they are. Originally I had passed the item into Page from a
previous
page and everything displays properly... but when I try to save any
changes
nothing is changed.
How do the pros handle this pattern?
-James Cicenia
_______________________________________________
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.