投稿‎ > ‎

JSFでタグに任意の属性を設定する

posted Mar 19, 2013, 1:32 AM by Zhang Wenxu   [ updated Jul 19, 2013, 9:03 AM ]

The attribute tag in JSF

You can already add arbitrary JSFattributes to components using theattribute tag. These end up on theattributes map. However, these will be ignored unless you implement a custom renderer to take advantage of them. They must work round existing property names on the component and result in overly verbose markup:

<x:foo>
  <f:attribute name="style" value="text: bold;">
  <f:attribute name="data-bar-baz" value="#{xxx}">
</x:foo>
tdタグにdisabled属性を制御したいが、disabled=""でも、非活性になってしまうため、上記jsf属性タグを利用して、
disabled属性の出力を制御できる。tdタグの出力制御を避けることで、コードが読みやすくなる。 Google+
By Zhang Wenxu
Comments