A classic link can be set with the <tc:link/>
tag.
You can also set a link by <tc:button/>
.
The behavior of a link and a button is the same, it differs in the appearance.
Tag Library Documentation:
The next two sections show how a link and a button is set.
'apache.org' leads to the appropriated website.
'Disable' show a disabled link/button.
'Action' use the action
attribute to link the #{demoBundle.component} section.
The image leads to www.apache.org.
<tc:link label="apache.org" link="https://www.apache.org/"/>
<tc:button label="apache.org" link="https://www.apache.org/"/>
Links and buttons can also be dropdown elements.
You can just put a link tag in another link or button tag
and set the omit
attribute for the parent.
<tc:link label="MusicPlayer" omit="true">
<tc:link image="fa-play-circle" label="Play"/>
...
</tc:link>
<tc:button label="MusicPlayer" omit="true">
<tc:link image="fa-play-circle" label="Play"/>
...
</tc:button>
<tc:button label="Options" omit="true">
<tc:selectOneRadio>
<tc:selectItem itemValue="Option 1"/>
...
</tc:selectOneRadio>
</tc:button>
A confirmation dialog can be added to a link or a button via
<f:facet name="confirmation">
.
The messagetext is added with <tc:out/>
.
The destination of the link can be set with the target
attribute.
For example a new window/tab or a specific iframe (<tc:object/>
).
<tc:link label="open https://www.apache.org/ in new window"
link="https://www.apache.org/" target="_blank"/>
The iframe is set with <tc:object name="objectframe" .../>
(see target
attribute is in this case 'objectframe'.