如何将复合组件相互嵌套?
例如,我有两个表示菜单和菜单项的组合,它们的用法如下:
<html ... xmlns:test="http://java.sun.com/jsf/composite/test">
...
<test:menu>
<test:menuItem value="#{someBean.someValue}"/>
<test:menuItem value="#{someBean.someOtherValue}"/>
</test:menu>
我想让它呈现为:
<select>
<option value="#{someBean.someValue}">#{someBean.someValue}</option>
<option value="#{someBean.someOtherValue}">#{someBean.someOtherValue}</option>
</select>
menu.xhtml
实现如下:
<composite:implementation>
<select>
<!-- How to get the <test:menuItem> here? -->
</select>
</composite:implementation>
menuItem.xhtml
实现如下:
<composite:implementation>
<option value="#{cc.attrs.value}"> #{cc.attrs.value} </option>
</composite:implementation>
我如何获得实施<test:menuItem>
中评论所确定的位置<test:menu>
?