Marcin Petrów
Marcin Petrów

Reputation: 1497

Custom components in JSF - what about sub-components (children)

When Im creating custom component in JSF do I have to create all sub-components in that same way?


For example:

h:dataTable component use h:column to determinate column parameters


Now if I want to create dataTable component do I have to implement in that same way a column component?

(PS. "that same way" mean:

Upvotes: 1

Views: 377

Answers (1)

Mike Braun
Mike Braun

Reputation: 3769

In general the answer is no. If you create a complex component like a datatable, it can simply take advantage of the existing components for defining columns.

As the designer of such a dataTable, you are the one who determines what's needed. The standard column afaik has no knowledge of the dataTable, but the dataTable has knowledge about the columns.

Also note that you don't often need to create tag classes. This is only needed for JSP compatibility, but as JSP is deprecated I would advise you to not support it unless you really have to.

Upvotes: 1

Related Questions