Emmanuel Demey
Emmanuel Demey

Reputation: 2228

Have an another Component directory (template and java files)

I have a question about Tapestry Component Programming. Can we have an another Component folder instead of the original one ?

If your reply is yes, How can you declare it (in the AppModule file ...) ?

Thanks

Upvotes: 1

Views: 168

Answers (3)

Mark
Mark

Reputation: 1238

If you need this level of separation and you can't get it with subpackages, you may be better of creating a separate component library as a separate project. This would give you a few advantages:

  1. Separately testable - you can have test that run on your components that don't need to be part of the main application.
  2. Reusable - you can use the component library in multiple projects without needing to cut and paste.
  3. Shareable - Many of the component libraries that are out there right now for Tapestry started when on person needed to solve a problem in the app they were creating, but did so in a generic way so they could use it again and could share it with others. In some cases you may be able to open source the components in a way that will let others contribute to them for everyone's benefit.

That said, if you absolutely need to have components in a different package, see pstanton's answer.

Upvotes: 0

You can create subpackages of the components package: .components.menu and then use or , for example. Having more than one root components package is something which I really can't see a good use for it. If you really want to do that, you can declare a new component library inside your application. Here's the documentation.

Upvotes: 2

pstanton
pstanton

Reputation: 36640

you can implement and contribute your own ComponentTemplateLocator

read this

Upvotes: 1

Related Questions