【发布时间】:2017-11-11 07:05:08
【问题描述】:
我正在实现我的自定义组件,如下所示。将此文件放在 web-> 资源文件夹
<html
xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:composite="http://java.sun.com/jsf/composite"
>
<h:body>
<composite:interface>
<composite:attribute name="width" default="300"/>
<composite:attribute name="height" default="400"/>
</composite:interface>
<composite:implementation>
<h:inputText style="height: #{composite.attrs.height}px"></h:inputText>
<span> #{composite.attrs.height}</span>
</composite:implementation>
</h:body>
</html>
但是 attrs.height 什么也不返回。
自定义组件如下所示
<my:mycustom height="40"></my:mycustom>
我在这里做错了什么。任何人都请帮我这样做。
【问题讨论】:
标签: jsf jsf-2 custom-component