gpt4 book ai didi

jsf-2 - JSF2 用户界面 :include pass variable number of input param

转载 作者:行者123 更新时间:2023-12-04 13:59:04 25 4
gpt4 key购买 nike

我们有一个通用组件,其中按钮或复选框的数量各不相同,标签也各不相同。我可以有一个通用的包含文件并传递可以变化的参数吗? 在包含文件中,有没有一种方法可以找到输入参数的数量,并根据该参数呈现尽可能多的按钮或复选框。

最佳答案

您可以使用 <ui:param>将参数传递给包含文件。

<ui:include src="/WEB-INF/includes/some.xhtml">
<ui:param name="number" value="3" />
</ui:include>

参数值在上面的特定示例中可用为 #{number}some.xhtml .

另一种方法是将包含文件注册为 .taglib.xml 中的标记文件。文件:

<tag>
<tag-name>some</tag-name>
<source>/WEB-INF/tags/some.xhtml</source>
</tag>

然后您可以将参数指定为标记文件属性:

<my:some number="3" />

这种方式也可用#{number}里面some.xhtml .

关于jsf-2 - JSF2 用户界面 :include pass variable number of input param,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10520055/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com