Howard,

Thank you for your answer, I understand what you mean, and thought about this approach.

But I dont see how I can do that for a property editor, since it is declared in its own page, and invoked implicitly through a beaneditor : I dont think I have the hand on what parameters are sent to it (maybe I missed something), all I can see is a PropertyEditContext is passed to the component. So I tried to find out if I can give my own implementation of that PropertyEditorContext, and putting in it a reference to the page that holds the bean editor, but couldnt.

On the other hand, what I want to do is to open my resource on PageAttach, and free it on PageDetach, there are several things in that, but basically, it's a JPA EntityManager. In a first version I had that in an injected service, but I have read / update or read / delete cycles in the same request, so I need to have the same entity manager all along the request. That is the reason why I moved it to the page, and it works fine, apart from that point.

José

Howard Lewis Ship a écrit :
I would address this using component parameters to tell the components
where they can obtain those resources from.  Perhaps there's a
ResourcesProvider interface that a page could implement.

The default for the parameter could be "componentResources.page",
which would provide the containing page, cast to ResourcesProvider.

For AppPropertyBlocks, you'll need to bind the parameter more
directly, to whatever works as a proper ResourcesProvider.

Does that help?

Could you move the resource provider to a service, instead of the page?



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to