On May 5, 2009, at 8:38 AM, Paul Hoadley wrote: Hi Ramsey, On 05/05/2009, at 8:24 AM, Ramsey Lee Gurley wrote: What I want to do is simple: have the general (non-app) page-level components wrapped by the (app-specific) LAF.wo. At the moment, I'm doing this by creating a proxy page-level component in the app which does nothing more than wrap the framework component in the LAF component. For example, say there's an EditFooPage.wo in Foo.framework, I create SomeAppEditFooPage.wo which puts EditFooPage.wo inside LAF.wo. This works just fine, but it would be nice to do it without the additional components in the app.
My first thought was to pass the name of the app-specific wrapper to EditFooPage.wo, and use a WOSwitchComponent in EditFooPage.wo to wrap it in LAF.wo. Although I haven't tried this, I assume it would work. However, LAF.wo offers some bindings to customise some of its behaviour. What I'd really like to do is be able to pass an actual component with some bindings set to EditFooPage.wo, which would then use this as its outermost component. Is there a standard approach for doing something like this?
Direct to Web. You'd pass the extra bindings via the d2wContext. Just create a new Wonder D2W app in Eclipse and look at the PageWrapper there.
Could you give me a little more on passing the extra bindings via the d2wContext?
Just to be clear, everything mentioned in my original post (modulo the fictitious names) already exists---I have an app with its PageWrapper-equivalent component, and the page-level components already exist in the external frameworks. The app has some D2W components in it, but it's not a full-blown D2W app. Can I generalise the approach to which you're referring to non-full-blown D2W apps?
If you wanted, you could set up a page configuration to use your EditFooPage component and have D2W return it like it would any other page component. However, if your EditFooPage.wo does not descend from D2WComponent, then the D2W factory will not call setLocalContext on your page, so you will not have a D2WContext. And without a d2wContext in your page, you won't be able to get the d2wContext in your page wrapper... You're right back where you started.
D2W is the standard approach to do what you are asking. All D2W pages are general, non-app, page level components wrapped by an app-specific page wrapper. The page wrapper can then get its additional bindings from the page's d2wContext. (Look at ERD2WHead for a concrete example of a pageWrapper component getting binding info from the d2wContext.)
If you can subclass D2WComponent, then I think it should work. Never tried it though :-)
Ramsey
|