做练习使用<a4j:commandButton>标签,但是页面却看不见按钮,自然也没有办法点击 <body>
点击按钮
<f:view>
<h:form>
<h:panelGrid>
<a4j:commandButton value="点击" action="#{bean.click}" rendered="output" />
<h:outputText value="#{bean.text}" id="output"></h:outputText>
</h:panelGrid>
</h:form>
</f:view>
</body>
应该是很简单的问题,但我google了半天也搜不到。
注:value="点击"可以正常显示,只是看不见按钮
点击按钮
<f:view>
<h:form>
<h:panelGrid>
<a4j:commandButton value="点击" action="#{bean.click}" rendered="output" />
<h:outputText value="#{bean.text}" id="output"></h:outputText>
</h:panelGrid>
</h:form>
</f:view>
</body>
应该是很简单的问题,但我google了半天也搜不到。
注:value="点击"可以正常显示,只是看不见按钮
你在a4j:commandButton标签中添加style设置一下背景色看看能不能点击
reRender 该组件调用Ajax请求后重新渲染的组件的ID(在 UIComopnent.findComponent()中使用),可以使一个id,也可以使逗号分开的很多id,或者是数据or集合的EL表达式 。
你的目的是想刷新下面的控件是吧?如果是的话,得用reRender ;rendered 是用来控制控件是否显示的。