blob: 70bde8ccbd70324b1032f51248e50c89ae193d92 [file] [log] [blame]
<!--
* 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://xmlns.jcp.org/jsf/facelets"
xmlns:f="http://xmlns.jcp.org/jsf/core">
<tc:section label="&lt;button> - &lt;a>">
<p>The left link is rendered as a <code>&lt;button></code>, the right side is rendered as an <code>&lt;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>&lt;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>&lt;tc:event rendered="false"></code>.</p>
<tc:button id="simpleSubmit" label="Simple Submit">
<tc:event target="_blank" rendered="false"/>
</tc:button>
</tc:section>
<tc:section label="Link Group">
<tc:segmentLayout extraLarge="6seg">
<tc:links>
<tc:link label="Active"/>
<tc:link label="Link"/>
<tc:link label="Link" link="https://www.apache.org"/>
<tc:link label="Disabled" disabled="true"/>
</tc:links>
<tc:panel>
<ul class="nav">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="#">Active</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a>
</li>
</ul>
</tc:panel>
<tc:panel>
<ul class="nav">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="#">Active</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a>
</li>
</ul>
</tc:panel>
<tc:links>
<tc:link label="Active"/>
<tc:link label="Link"/>
<tc:link label="Link" link="https://www.apache.org"/>
<tc:link label="Disabled" disabled="true"/>
</tc:links>
</tc:segmentLayout>
</tc:section>
</ui:composition>