Class HtmlCommandScript
- java.lang.Object
-
- jakarta.faces.component.UIComponent
-
- jakarta.faces.component.UIComponentBase
-
- jakarta.faces.component.UICommand
-
- jakarta.faces.component.html.HtmlCommandScript
-
- All Implemented Interfaces:
ActionSource
,ActionSource2
,PartialStateHolder
,StateHolder
,TransientStateHolder
,ComponentSystemEventListener
,FacesListener
,SystemEventListenerHolder
,EventListener
public class HtmlCommandScript extends UICommand
Represents an HTML
script
element for a function that acts like an ajax form submit. This component must be placed inside a form, and requires JavaScript to be enabled in the client.By default, the
rendererType
property must be set to "jakarta.faces.Script
". This value can be changed by calling thesetRendererType()
method.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
HtmlCommandScript.PropertyKeys
The property keys.
-
Field Summary
Fields Modifier and Type Field Description static String
COMPONENT_TYPE
The standard component type for this component.-
Fields inherited from class jakarta.faces.component.UICommand
COMPONENT_FAMILY
-
Fields 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 Constructor Description HtmlCommandScript()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getExecute()
Return the value of theexecute
property.String
getName()
Return the value of thename
property.String
getOnerror()
Return the value of theonerror
property.String
getOnevent()
Return the value of theonevent
property.String
getRender()
Return the value of therender
property.Boolean
getResetValues()
Return the value of theresetValues
property.boolean
isAutorun()
Return the value of theautorun
property.void
setAutorun(boolean autorun)
Set the value of theautorun
property.void
setExecute(String execute)
Set the value of theexecute
property.void
setName(String name)
Set the value of thename
property.void
setOnerror(String onerror)
Set the value of theonerror
property.void
setOnevent(String onevent)
Set the value of theonevent
property.void
setRender(String render)
Set the value of therender
property.void
setResetValues(Boolean resetValues)
Set the value of theresetValues
property.-
Methods inherited from class jakarta.faces.component.UICommand
addActionListener, broadcast, getActionExpression, getActionListeners, getFamily, getValue, isImmediate, queueEvent, removeActionListener, setActionExpression, setImmediate, setValue
-
Methods inherited from class jakarta.faces.component.UIComponentBase
addClientBehavior, addFacesListener, clearInitialState, decode, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientBehaviors, getClientId, getDefaultEventName, getEventNames, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getListenersForEventClass, getParent, getPassThroughAttributes, getRenderer, getRendererType, getRendersChildren, invokeOnComponent, isRendered, isTransient, markInitialState, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, removeFacesListener, restoreAttachedState, restoreState, saveAttachedState, saveState, setId, setParent, setRendered, setRendererType, setTransient, subscribeToEvent, unsubscribeFromEvent
-
Methods inherited from class jakarta.faces.component.UIComponent
encodeAll, getClientId, getCompositeComponentParent, getContainerClientId, getCurrentComponent, getCurrentCompositeComponent, getNamingContainer, getPassThroughAttributes, getResourceBundleMap, getStateHelper, getStateHelper, getTransientStateHelper, getTransientStateHelper, getValueExpression, initialStateMarked, isCompositeComponent, isInView, isVisitable, popComponentFromEL, processEvent, pushComponentToEL, restoreTransientState, saveTransientState, setInView, setValueExpression, visitTree
-
-
-
-
Field Detail
-
COMPONENT_TYPE
public static final String COMPONENT_TYPE
The standard component type for this component.
- See Also:
- Constant Field Values
-
-
Method Detail
-
isAutorun
public boolean isAutorun()
Return the value of the
autorun
property.- Returns:
- the property value
Contents: Whether to execute declared JavaScript function during
load
event of thewindow
. Defaults tofalse
.
-
setAutorun
public void setAutorun(boolean autorun)
Set the value of the
autorun
property.- Parameters:
autorun
- the new property value
-
getExecute
public String getExecute()
Return the value of the
execute
property.- Returns:
- the property value
Contents: This is a space separated list of client identifiers of components that will participate in the "execute" portion of the Request Processing Lifecycle. If a literal is specified the identifiers must be space delimited. Any of the keywords "@this", "@form", "@all", "@none" may be specified in the identifier list. If not specified, the default value of "@this" is assumed. For example,
@this clientIdOne clientIdTwo
.
-
setExecute
public void setExecute(String execute)
Set the value of the
execute
property.- Parameters:
execute
- the new property value
-
getName
public String getName()
Return the value of the
name
property.- Returns:
- the property value
Contents: Name of JavaScript function to be declared, e.g.
name="functionName"
. This can be a namespaced function name, e.g.name="ez.functionName"
.
-
setName
public void setName(String name)
Set the value of the
name
property.- Parameters:
name
- the new property value
-
getOnerror
public String getOnerror()
Return the value of the
onerror
property.- Returns:
- the property value
Contents: The name of the JavaScript function that will handle errors.
-
setOnerror
public void setOnerror(String onerror)
Set the value of the
onerror
property.- Parameters:
onerror
- the new property value
-
getOnevent
public String getOnevent()
Return the value of the
onevent
property.- Returns:
- the property value
Contents: The name of the JavaScript function that will handle UI events.
-
setOnevent
public void setOnevent(String onevent)
Set the value of the
onevent
property.- Parameters:
onevent
- the new property value
-
getRender
public String getRender()
Return the value of the
render
property.- Returns:
- the property value
Contents: This is a space separated list of client identifiers of components that will participate in the "render" portion of the Request Processing Lifecycle. If a literal is specified the identifiers must be space delimited. Any of the keywords "@this", "@form", "@all", "@none" may be specified in the identifier list. If not specified, the default value of "@none" is assumed. For example,
@this clientIdOne clientIdTwo
.
-
setRender
public void setRender(String render)
Set the value of the
render
property.- Parameters:
render
- the new property value
-
getResetValues
public Boolean getResetValues()
Return the value of the
resetValues
property.- Returns:
- the property value
Contents: Reset specific input values. Interpret the value of the
render
attribute as a space separated list of client identifiers suitable for passing directly toUIViewRoot.resetValues()
. The implementation must cause anActionListener
to be attached to theActionSource
component in which this tag is nested that callsUIViewRoot.resetValues()
passing the value of therender
attribute as the argument.
-
setResetValues
public void setResetValues(Boolean resetValues)
Set the value of the
resetValues
property.- Parameters:
resetValues
- the new property value
-
-