From: Alex B. <en...@tu...> - 2001-07-10 17:54:33
|
> Alex: > > Now Alex, with that arcane Subject:, I hope to get your > attention. > > I think this is important, I have been working hours on this > problem, and I think I have been very careful. This problem > is difficult to explain, so give me some latitude. To > get your attention, your allegation that inter-module > communication via the construct: > > $Page->modules[group][idx_in_group]->some_method_or_parm; > > DOES NOT WORK anymore since you changed the machinery from > using Init() to having a constructor instead. That has nothing to do with Init or a Constructor? That's a fairly standard, boring class reference. Remember that to reference a module, the module doing the ref must load _after_ the target. > --------------------------- > 1. I have a Warning module that collects warnings from > any module, on a stack, and in the page render > I display them all in a "pane". > 2. This Warning module is in a group 'bottom', all > by itself. > 3. From another module, I call a method in the Warning > module to stack a warning thus: > > $Page->modules['bottom'][0]->setWarning($msg); > > to stack the warning ($msg) within the Warning > module/Class on $this->WarningStack. > 4. Before Init() was dropped, and the constructor used, > I put the stack ($WarningStack) global. The code > worked fine, any warning anywhere from any other > module was collected on the stack. You can keep that Global, again Init(); has nothing to do with it? > 5. When a constructor was introduced, I moved $WarningStack > inside the Warning class as a var $WarningStack; > > What it seems like is that inter-module communication via > your suggested construct, or the one I am also using, via > a "tag", is only talking to a copy of the "real class". > In the application, all warnings I collect (and from that > module, verify that they are on the stack, by the same > construct as above) appear to be present. What that means > is if I do from the outside, so to speak: > > $Page->modules['bottom'][0]->showWarnings(); > > the stack contains all of the warnings collected. > > BUT, by the time the Warning module is ready to Output(), > the stack $this->WarningStack ONLY HAS stacked data that > it put there itself. The "outside" warnings are not present. That sounds like a problem with your module. > What is going on here? Who made the copy, where is > the copy, why don't I have only one stack since > I moved it within the Warning class? I don't know. _a -- alex black, ceo en...@tu... the turing studio, inc. http://www.turingstudio.com vox+510.666.0074 fax+510.666.0093 |