- All Implemented Interfaces:
ClientBehaviorHolder,PartialStateHolder,StateHolder,TransientStateHolder,ValueHolder,ComponentSystemEventListener,FacesListener,SystemEventListenerHolder,EventListener
The <o:link> is a component that extends the standard <h:link> and allows
including the request query string parameters of the current URL into the link's target URL. Standard Faces
<h:link> does not include any query string parameters which are not declared as view parameters.
This is particularly useful if you expect some state in the target page and don't want to repeat
<f|o:param> all over place.
You can use it the same way as <h:link>, you only need to change h: to
o:.
Include request params
When you want to include request query string parameters of the current URL into the link's target URL, set the
includeRequestParams attribute to true.
<o:link value="Go to some page with same query string" outcome="some-page" includeRequestParams="true">
- Since:
- 4.5
- Author:
- Bauke Scholtz
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe component type, which is "org.omnifaces.component.output.Link".Fields inherited from class jakarta.faces.component.html.HtmlOutcomeTargetLink
COMPONENT_FAMILYFields inherited from class jakarta.faces.component.UIComponent
ATTRS_WITH_DECLARED_DEFAULT_VALUES, BEANINFO_KEY, bindings, COMPOSITE_COMPONENT_TYPE_KEY, COMPOSITE_FACET_NAME, FACETS_KEY, VIEW_LOCATION_KEY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidencodeBegin(FacesContext context) Returns the identifier of the page fragment which should be brought into focus when the target page is rendered.booleanReturns whether or not the request parameters should be encoded into the target URL.voidsetFragment(String fragment) Sets the identifier of the page fragment which should be brought into focus when the target page is rendered.voidsetIncludeRequestParams(boolean includeRequestParams) Sets whether or not the request parameters should be encoded into the target URL.Methods inherited from class jakarta.faces.component.html.HtmlOutcomeTargetLink
addClientBehavior, getAccesskey, getCharset, getCoords, getDir, getEventNames, getFamily, getHreflang, getLang, getOnblur, getOnclick, getOndblclick, getOnfocus, getOnkeydown, getOnkeypress, getOnkeyup, getOnmousedown, getOnmousemove, getOnmouseout, getOnmouseover, getOnmouseup, getRel, getRev, getRole, getShape, getStyle, getStyleClass, getTabindex, getTarget, getTitle, getType, isDisabled, setAccesskey, setCharset, setCoords, setDir, setDisabled, setHreflang, setLang, setOnblur, setOnclick, setOndblclick, setOnfocus, setOnkeydown, setOnkeypress, setOnkeyup, setOnmousedown, setOnmousemove, setOnmouseout, setOnmouseover, setOnmouseup, setRel, setRev, setRole, setShape, setStyle, setStyleClass, setTabindex, setTarget, setTitle, setType, setValueExpressionMethods inherited from class jakarta.faces.component.UIOutcomeTarget
getOutcome, isDisableClientWindow, isIncludeViewParams, setDisableClientWindow, setIncludeViewParams, setOutcomeMethods inherited from class jakarta.faces.component.UIOutput
clearInitialState, getConverter, getLocalValue, getValue, markInitialState, resetValue, restoreState, saveState, setConverter, setValueMethods inherited from class jakarta.faces.component.UIComponentBase
addFacesListener, broadcast, decode, encodeAll, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientBehaviors, getClientId, getDefaultEventName, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getPassThroughAttributes, getRenderer, getRendererType, getRendersChildren, invokeOnComponent, isRendered, isTransient, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, visitTreeMethods inherited from class jakarta.faces.component.UIComponent
getClientId, getCompositeComponentParent, getContainerClientId, getCurrentComponent, getCurrentCompositeComponent, getListenersForEventClass, getNamingContainer, getPassThroughAttributes, getResourceBundleMap, getStateHelper, getStateHelper, getTransientStateHelper, getTransientStateHelper, getValueExpression, initialStateMarked, isCompositeComponent, isInView, isVisitable, popComponentFromEL, processEvent, pushComponentToEL, restoreTransientState, saveTransientState, setInView, subscribeToEvent, unsubscribeFromEventMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface jakarta.faces.component.behavior.ClientBehaviorHolder
getClientBehaviors, getDefaultEventName
-
Field Details
-
COMPONENT_TYPE
The component type, which is "org.omnifaces.component.output.Link".- See Also:
-
-
Constructor Details
-
Link
public Link()
-
-
Method Details
-
encodeBegin
- Overrides:
encodeBeginin classUIComponentBase- Throws:
IOException
-
isIncludeRequestParams
public boolean isIncludeRequestParams()Returns whether or not the request parameters should be encoded into the target URL. Defaults tofalse.- Returns:
- Whether or not the request parameters should be encoded into the target URL.
-
setIncludeRequestParams
public void setIncludeRequestParams(boolean includeRequestParams) Sets whether or not the request parameters should be encoded into the target URL. Defaults tofalse.- Parameters:
includeRequestParams- Whether or not the request parameters should be encoded into the target URL.
-
getFragment
Returns the identifier of the page fragment which should be brought into focus when the target page is rendered. The value of this attribute is appended to the end of target URL following a hash (#) mark. This notation is part of the standard URL syntax.- Returns:
- The page fragment identifier.
-
setFragment
Sets the identifier of the page fragment which should be brought into focus when the target page is rendered. The value of this attribute is appended to the end of target URL following a hash (#) mark. This notation is part of the standard URL syntax.- Parameters:
fragment- The page fragment identifier.
-