如何使commandButton不能完全刷新页面?如何使用f:ajax?

我必须流式传输网络摄像头视频,所以我要使用ustream来执行此操作,这会为我生成一个Flash嵌入代码,而且我有一个按钮可以关闭/打开灯,但是当我按该按钮时,它将刷新整个页面,因此是Flash组件。


有一些方法可以不刷新页面而仍然发送到命令?好吧,现在是这样的:


        <h:form id="form_supervisory">

            <h:panelGrid>

                <h:column>

                    <iframe width="480" height="296" src="http://www.ustream.tv/embed/9599890" scrolling="no" frameborder="0" style="border: 0px none transparent;">    </iframe>

                    <h:commandButton value="Lâmpada" action="#{supervisoryc.invertBo}" />

                    <h:graphicImage value="#{supervisoryc.imageBo}" />

                </h:column>

            </h:panelGrid>

        </h:form>


慕勒3428872
浏览 293回答 1
1回答

HUX布斯

利用Ajax。这只是嵌套<f:ajax>在感兴趣的命令按钮中的问题。<h:commandButton ...>&nbsp; &nbsp; <f:ajax execute="@form" render="@none" /></h:commandButton>特别是render="@none"(无论如何都是默认值,您可以完全忽略该属性)将指示JSF在提交之后重新渲染任何内容。如果打算仅重新渲染特定组件而不是整个页面,则还可以在render属性中指定该特定组件的ID 。<h:commandButton ...>&nbsp; &nbsp; <f:ajax execute="@form" render="result" /></h:commandButton><h:panelGroup id="result">...</h:panelGroup>
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript