public final class AjaxRequestAttributes extends Object
Modifier and Type | Class and Description |
---|---|
static class |
AjaxRequestAttributes.EventPropagation
The JavaScript event propagation type
|
static class |
AjaxRequestAttributes.Method
The method to be used when submitting a form
|
Modifier and Type | Field and Description |
---|---|
static String |
XML_DATA_TYPE |
Constructor and Description |
---|
AjaxRequestAttributes() |
public static final String XML_DATA_TYPE
public CharSequence getChildSelector()
childSelector
public void setChildSelector(CharSequence childSelector)
childSelector
- The selector string that filters the descendantschildSelector
public boolean isMultipart()
Note that for multipart AJAX requests a hidden IFRAME will be used and that can have negative impact on error detection.
true
if the form submit should be multipart, false
otherwisepublic AjaxRequestAttributes setMultipart(boolean multipart)
Note that for multipart AJAX requests a hidden IFRAME will be used and that can have negative impact on error detection.
multipart
- public AjaxRequestAttributes.Method getMethod()
GET
or POST
.
For a POST
request all URL arguments are submitted as body. This can be useful if
the URL parameters are longer than maximal URL length.
public AjaxRequestAttributes setMethod(AjaxRequestAttributes.Method method)
GET
or POST
.
For a POST
request all URL arguments are submitted as body. This can be useful if
the URL parameters are longer than maximal URL length.
method
- the type of the Ajax requestthis
object for chainingpublic Duration getRequestTimeout()
null
in which case the
default request timeout will be used.null for default timeout. Default: no timeout.
public AjaxRequestAttributes setRequestTimeout(Duration requestTimeout)
null
in which case the
default request timeout will be used.requestTimeout
- public List<IAjaxCallListener> getAjaxCallListeners()
IAjaxCallListener
s which will be notified during the the execution
of the Ajax call.public Map<String,Object> getExtraParameters()
getDynamicExtraParameters()
public List<CharSequence> getDynamicExtraParameters()
If there are no multivalued parameters then the function can return a simple JavaScript object. Example:
return { 'param1': document.body.tagName, 'param2': calculateParam2() }
If there are multivalued parameters then an array of objects may be used. Example:
return [ { name: 'param1', value: document.body.tagName }, { name: 'param1', value: calculateSecondValueForParam1() }, { name: 'param2', value: calculateParam2() } ]
getExtraParameters()
public boolean isPreventDefault()
true
, the link's
URL will not be followed. If the Ajax behavior is attached to a checkbox or a radio button
then the default behavior should be allowed to actually check the box or radio button, i.e.
this method should return false
.false
if the default event handler should be invokedpublic AjaxRequestAttributes setPreventDefault(boolean preventDefault)
preventDefault
- this
object for chainingisPreventDefault()
,
isPreventDefault()
public AjaxRequestAttributes.EventPropagation getEventPropagation()
public AjaxRequestAttributes setEventPropagation(AjaxRequestAttributes.EventPropagation eventPropagation)
eventPropagation
- the type of the stopthis
object, for chainingpublic AjaxRequestAttributes setAsynchronous(boolean async)
async
- a flag whether to do asynchronous Ajax call or notthis
object for chainingpublic boolean isAsynchronous()
public AjaxChannel getChannel()
public AjaxRequestAttributes setChannel(AjaxChannel channel)
channel
- the Ajax channel to use. Pass null
to use the default channel with name
0 and queueing type.this
object for chainingpublic String[] getEventNames()
public AjaxRequestAttributes setEventNames(String... eventNames)
eventNames
- the names of the events which will trigger the Ajax callthis
object for chainingpublic String getFormId()
public AjaxRequestAttributes setFormId(String formId)
formId
- the id of the for that should be submittedthis
object for chainingpublic String getSubmittingComponentName()
public AjaxRequestAttributes setSubmittingComponentName(String submittingComponentName)
submittingComponentName
- the input name of the button/link that submits the formthis
object for chainingpublic boolean isWicketAjaxResponse()
true
.public AjaxRequestAttributes setWicketAjaxResponse(boolean wicketAjaxResponse)
wicketAjaxResponse
- a flag indicating whether the Ajax response should be processed by Wicket (i.e. to
replace components, execute scripts, etc.).this
object for chainingpublic String getDataType()
public AjaxRequestAttributes setDataType(String dataType)
dataType
- the type of the data in the Ajax response.this
object for chainingpublic ThrottlingSettings getThrottlingSettings()
public AjaxRequestAttributes setThrottlingSettings(ThrottlingSettings throttlingSettings)
throttlingSettings
- the settings to use when throttling is needed. Pass null
to disable
throttling.this
object for chainingpublic boolean isSerializeRecursively()
public AjaxRequestAttributes setSerializeRecursively(boolean serializeRecursively)
serializeRecursively
- a flag indicating whether to collect (submit) the name/value pairs for all HTML form elements
children of the HTML element with the JavaScript listenerCopyright © 2006–2022 Apache Software Foundation. All rights reserved.