jsf - How make commandButton not fully refresh page? How to use f:ajax? -


i have stream webcam video, use ustream that, generate flash embed code me, , have button turn off/on light, when press button refresh whole page , flash component.

there's way not refresh page , still send command ? it's way:

        <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> 

make use of ajax. it's matter of nesting <f:ajax> inside command button of interest.

<h:commandbutton ...>     <f:ajax execute="@form" render="@none" /> </h:commandbutton> 

particularly render="@none" (which default value anyway, omit attribute altogether) instruct jsf re-render nothing after submit. if intend re-render specific component instead of whole page, specify id of specific component in render attribute.

<h:commandbutton ...>     <f:ajax execute="@form" render="result" /> </h:commandbutton> <h:panelgroup id="result">...</h:panelgroup> 

see also:


Comments

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -