Em Tue, 17 Feb 2009 19:17:19 -0300, Piero Sartini <li...@pierosartini.de>
escreveu:
Thank you so much.. it works! :-)
Does it work? Nice! I have never tried something like I suggested! :D
I will write down a short howto in the wiki tomorrow. (is the wiki open
to everyone?)
Open to everyone and your howto will be very useful, as this kind of
questions arises ofter in this mailing list.
But you are right... the code really looks not that nice compared to the
elegance tapestry is providing in other areas. Maybe that's the reason
why I was under the impression that there has to be another way.
Tapestry's issue trackes is also open to everyone:
https://issues.apache.org/jira/browse/TAP5. You can file a JIRA (issue) to
ask for a better way to get a block from a page or component without
having to @Inject it.
Think about the nice ioc functionality of dropping in new components - we
loose this for that page. But it would make a lot of sense to bundle new
widgets in jar files....
You can do something like that already. Take a look at
http://tapestry.apache.org/tapestry5/guide/beaneditform.html: this page
shows how to add functionality to BeanEditForm (and Grid, BeanDisplay and
BeanEditor too) providing blocks. In a page, you can inject another page
(let's call it X) and then render X's components using Delegate. Adding
new pages/components/mixins from a JAR is easy too: see
http://tapestry.apache.org/tapestry5/tapestry-ioc/autoload.html and the
ComponentClassResolver Tapestry service. Adding this method to a
Tapestry-IoC module, I can add a component library to my application:
public static void contributeComponentClassResolver(
Configuration<LibraryMapping> configuration,
TapestryCrudModuleService tapestryCrudModuleService) {
configuration.add(new LibraryMapping(
Constants.TAPESTRY_CRUD_LIBRARY_PREFIX,
"br.com.arsmachina.tapestrycrud")); // my library root
package
}
--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org