我如何根据背bean中的布尔来隐藏 h:ouputLink
?
因为我这样禁用它:
<h:commandButton disabled="#{backing.property}" />
但是我该如何完全隐藏?
with:
<h:commandButton id="myComponent" rendered="#{backing.property}" />
对不起,我的错。您正在搜索H:outputLink。因为两个 h:outputLink 和 h:commandbutton 均来自uicomponentbase,所以两个派生的类都有方法isRendered()
,并且您无需将命令链接包装在某种面板中。<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
<h:outputLink rendered="#{backing.property}" />
update
myComponent 将由于不会渲染而被"隐藏"。不要渲染 myComponent 表示您需要在 myComponent myComponent 上进行更新(例如,使用AJAX请求)进行更新(例如/p> 请参阅API规范:Javatm平台,Enterprise Edition 6 API规范<h:panelGrid id="myPanelGrid">
....
<h:outputLink id="myComponent" rendered="#{backing.property}" />
....
<h:panelGrid>
<h:commandButton value="show" action="#{backing.setPropertyToTrueMethod}" update="myPanelGrid" />