java.lang.Object
de.agilecoders.wicket.jquery.JQuery
- All Implemented Interfaces:
Serializable,IClusterable
The Jquery class helps to keep all javascript jquery scripts type safe.
- Author:
- miha
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic JQuery$()static JQueryhelper method to allow a jquery like code stylestatic JQuery$(CharSequence selector) helper method to allow a jquery like code style.static JQueryhelper method to allow a jquery like code stylestatic JQueryhelper method to allow a jquery like code stylestatic JQuery$(Component component, CharSequence... additionalSelector) helper method to allow a jquery like code stylestatic Attrcreates a auto detect attributebuild()adds a chained function to this jquery instancechain(CharSequence functionName) adds a chained function to this jquery instancechain(CharSequence functionName, Config config, Config... extraConfigs) adds a chained function to this jquery instanceFor each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.closest(CharSequence selector) For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.Get the descendants of each element in the current set of matched elements, filtered by a selector.find(CharSequence selector) Get the descendants of each element in the current set of matched elements, filtered by a selector.get()static Attr.MarkupIdmarkupId(CharSequence markupId) creates a quoted markup id selectorstatic Attr.MarkupIdcreates a quoted markup id selectoron(Attr events, Attr selector, JavaScriptInlineFunction handler) Attach an event handler function for one or more events to the selected elements.on(Attr events, JavaScriptInlineFunction handler) Attach an event handler function for one or more events to the selected elements.on(CharSequence events, JavaScriptInlineFunction handler) Attach an event handler function for one or more events to the selected elements.on(CharSequence events, CharSequence selector, JavaScriptInlineFunction handler) Attach an event handler function for one or more events to the selected elements.static Attrplain(CharSequence value) creates a plain attribute without quotesstatic Attrquoted(CharSequence value) creates a quoted attribute
-
Method Details
-
quoted
creates a quoted attribute- Parameters:
value- the selector- Returns:
- quoted attribute
-
plain
creates a plain attribute without quotes- Parameters:
value- the selector- Returns:
- plain attribute
-
markupId
creates a quoted markup id selector- Parameters:
component- the component to extract markup id- Returns:
- plain attribute
-
markupId
creates a quoted markup id selector- Parameters:
markupId- the markup id- Returns:
- plain attribute
-
auto
creates a auto detect attribute- Parameters:
value- the selector- Returns:
- the attribute value
-
$
helper method to allow a jquery like code style. The selector will be quoted.JQuery.$("selector") // = $('selector')- Parameters:
selector- The jquery selector- Returns:
- new Jquery instance
-
$
helper method to allow a jquery like code styleJQuery.$(plain("document")) // = $(document)- Parameters:
selector- The jquery selector- Returns:
- new Jquery instance
-
$
helper method to allow a jquery like code style- Parameters:
component- The markup id of given component is used as jquery selector- Returns:
- new Jquery instance
-
$
helper method to allow a jquery like code style- Parameters:
component- The markup id of given component is used as jquery selectoradditionalSelector- an additional initial selector- Returns:
- new Jquery instance
-
$
helper method to allow a jquery like code style- Parameters:
component- The markup id of given component is used as jquery selectoradditionalSelector- an additional initial selector- Returns:
- new Jquery instance
-
$
-
chain
adds a chained function to this jquery instance- Parameters:
function- the function to add- Returns:
- this instance for chaining
-
on
Attach an event handler function for one or more events to the selected elements. Theeventsparameter will be quoted.- Parameters:
events- One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin".handler- A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false.- Returns:
- this instance for chaining.
-
on
Attach an event handler function for one or more events to the selected elements. Theeventsandselectorparameter will be quoted.- Parameters:
events- One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin".selector- A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element.handler- A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false.- Returns:
- this instance for chaining.
-
on
Attach an event handler function for one or more events to the selected elements.- Parameters:
events- One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin".selector- A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element.handler- A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false.- Returns:
- this instance for chaining.
-
on
Attach an event handler function for one or more events to the selected elements.- Parameters:
events- One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin".handler- A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false.- Returns:
- this instance for chaining.
-
closest
For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.- Parameters:
selector- the selector to use (will be quoted).- Returns:
- this instance for chaining
-
closest
For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.- Parameters:
selector- the selector to use.- Returns:
- this instance for chaining
-
find
Get the descendants of each element in the current set of matched elements, filtered by a selector.- Parameters:
selector- the selector to use (will be quoted).- Returns:
- this instance for chaining
-
find
Get the descendants of each element in the current set of matched elements, filtered by a selector.- Parameters:
selector- the selector to use.- Returns:
- this instance for chaining
-
chain
adds a chained function to this jquery instance- Parameters:
functionName- the function to add- Returns:
- this instance for chaining
-
get
- Returns:
- this jquery chain as string and a semicolon as last char
-
build
- Returns:
- this jquery chain as string but doesn't close chain with semicolon.
-
asDomReadyScript
- Returns:
- this jquery script as
OnDomReadyHeaderIteminstance
-
chain
adds a chained function to this jquery instance- Parameters:
functionName- the function to addconfig- the function configuration- Returns:
- this instance for chaining
-