Gareth Kirwan wrote: >> I'm not quite sure what you're trying to achieve here. It sounds like >> you want your dhandler to act like an autohandler sometimes, >> but not others? >> >> If you want this behaviour, why not get your final component to inherit >>from the dhandler; that way the code for deciding if the dhandler is >> used is in the final component. You would, however, have to get your >> dhandler to determine whether it should do $m->call_next or not. >> >> But still, I'm not sure I really understand what you're trying to do. >> Let me know if this advice is anywhere near the mark. > > What I'm saying is much simpler, and can strip out everything else: > Sometimes you want to add a component to the end of the wrapping chain. > A request component was called, be it a dhandler or another component. > That component wants to call another component. > It wants that component to be considered the request component, > and be at the bottom of the request inheritence chain. > > So anywhere in the component inheritence chain, after chain_append is done, > reuqest_comp will refer to this new component, and calling a method on that > will scale up the inheritence chain correctly. > > dhandler was the best situation to describe this with, and the one that I > encountered the need with. > You ask for a component. > That component doesn't exist. > A dhandler is called, and that decides which component really does need to > handle this. > In every sense it is now right to make that component the request_comp. > The dhandler can stay in the chain above the request comp so that methods in > it can > still be inherited. > > Another way of achieving all of this would be to subexec, which I've done in > other cases. > In this situation it would be the worst solution, and doesn't fit the best > model. >
Ahh, I see what you're saying. I think the problem is that the wrapping chain is determined before the code in the components is executed. I really don't have any advise in that case, sorry. If your solution works, then go with it. Personally, I'd try to refactor the site so that you don't have this problem. Maybe there's another layout you could use to avoid this? I don't know... -Oli
signature.asc
Description: OpenPGP digital signature
------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users