The left link is rendered as a <button>, the right side is rendered as an <a>. Both representations have to be similar.
<button>
<a>
Open a new tab on each link. Make sure you test the confirmation-link with "OK" and "Cancel".
Opens a blank browser tab on click, because rendered attribute is not set in <tc:event>.
<tc:event>
Simple submit on click because rendered attribute is set to false in <tc:event rendered="false">.
<tc:event rendered="false">
<!-- * 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" xmlns:f="http://java.sun.com/jsf/core"> <ui:param name="title" value="#{demoBundle.button_link} <tc:link> <tc:button>"/> <tc:section label="<button> - <a>"> <p>The left link is rendered as a <code><button></code>, the right side is rendered as an <code><a></code>. Both representations have to be similar.</p> <tc:segmentLayout extraSmall="6seg 6seg"> <tc:flexLayout columns="auto auto" id="fl1"> <tc:in id="action"/> <tc:link label="actionLink" action="#{buttonLinkController.linkToComponentsRoot}"/> </tc:flexLayout> <tc:flexLayout columns="auto auto" id="fl2"> <tc:out label="label" value="value"/> <tc:in id="href"/> <tc:link label="hrefLink" link="https://www.apache.com/"/> </tc:flexLayout> </tc:segmentLayout> </tc:section> <tc:section label="New Tab"> <p>Open a new tab on each link. Make sure you test the confirmation-link with "OK" and "Cancel".</p> <ul> <li>Right-click -> New Tab</li> <li>Middle-click</li> <li>CMD/CTRL + Left-click</li> </ul> <tc:buttons> <tc:button id="standardButton" label="Standard" link="https://www.apache.org/"/> <tc:button id="confirmationButton" label="Confirmation" link="https://www.apache.org/" confirmation="Are you sure?"/> <tc:button id="targetFrameButton" label="Target: Frame" link="https://www.apache.org/" target="targetFrame"/> <tc:button id="targetBlankButton" label="Target: _blank" link="https://www.apache.org/" target="_blank"/> </tc:buttons> <tc:links> <tc:link id="standardLink" label="Standard" link="https://www.apache.org/"/> <tc:link id="confirmationLink" label="Confirmation" link="https://www.apache.org/" confirmation="Are you sure?"/> <tc:link id="targetFrameLink" label="Target: Frame" link="https://www.apache.org/" target="targetFrame"/> <tc:link id="targetBlankLink" label="Target: _blank" link="https://www.apache.org/" target="_blank"/> </tc:links> <br/> <br/> <tc:button id="resetTarget" label="Reset Target Frame"> <f:ajax render="targetFrame"/> </tc:button> <tc:object id="targetFrame" name="targetFrame"> <tc:style width="100%" height="300px"/> </tc:object> </tc:section> <tc:section label="Event Test"> <p>Opens a blank browser tab on click, because rendered attribute is not set in <code><tc:event></code>.</p> <tc:button id="openTab" label="Open in new Tab"> <tc:event target="_blank"/> </tc:button> <p>Simple submit on click because rendered attribute is set to false in <code><tc:event rendered="false"></code>.</p> <tc:button id="simpleSubmit" label="Simple Submit"> <tc:event target="_blank" rendered="false"/> </tc:button> </tc:section> </ui:composition>