开发者

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

开发者 https://www.devze.com 2023-03-24 05:12 出处:网络
When Im creating custom component in JSF do I have to create all sub-components in that same way? For example:

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开发者_如何学JAVA same way" mean:

  • create DataTable class extends i.e. UIOutput
  • create DataTableTab class extends UIComponentELTag
  • append configuration to custom.taglib.xml


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消