For command components like a link or a button, the transition attribute is available. It shows a loading animation if the site don't respond in a certain amount of time. By default, the value is 'true'.
transition
Tag Library Documentation: <tc:link/> | <tc:button/>
By following one of the links, the site waits five seconds. After that, you will be redirected to another page.
<tc:link label="link with transition ON" action="#{transitionController.sleep5sAndRedirect}"/> <tc:link label="link with transition OFF" transition="false" action="#{transitionController.sleep5sAndRedirect}"/>
In this example, a popup dialog is shown five seconds after pressing one of the buttons.
<?xml version="1.0" encoding="UTF-8"?> <!-- * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. --> <ui:composition template="/main.xhtml" xmlns="http://www.w3.org/1999/xhtml" xmlns:tc="http://myfaces.apache.org/tobago/component" xmlns:ui="http://java.sun.com/jsf/facelets"> <ui:param name="title" value="#{demoBundle.transition}"/> <p>For command components like a link or a button, the <code>transition</code> attribute is available. It shows a loading animation if the site don't respond in a certain amount of time. By default, the value is 'true'.</p> <p>Tag Library Documentation: <tc:link label="<tc:link/>" image="#{request.contextPath}/image/feather-leaf.png" link="#{demoBundle.tagDocUrl}/#{apiController.currentRelease}/tld/tc/link.html"/> | <tc:link label="<tc:button/>" image="#{request.contextPath}/image/feather-leaf.png" link="#{demoBundle.tagDocUrl}/#{apiController.currentRelease}/tld/tc/button.html"/></p> <tc:section label="Basics"> <p>By following one of the links, the site waits five seconds. After that, you will be redirected to another page.</p> <pre><code class="language-markup"><tc:link label="link with transition ON" action="\#{transitionController.sleep5sAndRedirect}"/> <tc:link label="link with transition OFF" transition="false" action="\#{transitionController.sleep5sAndRedirect}"/></code></pre> <tc:link label="link with transition ON" action="#{transitionController.sleep5sAndRedirect}"/> <br/> <tc:link label="link with transition OFF" transition="false" action="#{transitionController.sleep5sAndRedirect}"/> </tc:section> <tc:section label="Popup"> <p>In this example, a popup dialog is shown five seconds after pressing one of the buttons.</p> <tc:popup id="popup"> <tc:box label="Info"> <p>Button pressed</p> <tc:button label="Close" omit="true"> <tc:operation name="hide" for="popup"/> </tc:button> </tc:box> </tc:popup> <tc:button label="Open Popup (transition ON)" action="#{transitionController.sleep5s}"> <tc:operation name="show" for="popup"/> </tc:button> <tc:button label="Open Popup (transition OFF)" action="#{transitionController.sleep5s}" transition="false"> <tc:operation name="show" for="popup"/> </tc:button> </tc:section> </ui:composition>