Class WebXContainerElement
java.lang.Object
webx.WebXElement
webx.WebXContainerElement
- Direct Known Subclasses:
A,Abbr,Address,Article,Aside,Audio,B,Bdi,Bdo,BlockQuote,Button,Canvas,Caption,Cite,Code,ColGroup,Content,Data,DataList,Del,Details,Dialog,Div,Dl,Dt,Em,FieldSet,FigCaption,Figure,Footer,Form,H1,H2,H3,H4,H5,H6,Header,HGroup,Html,I,IFrame,Ins,Kbd,Label,Legend,Li,Main,Map,Mark,Menu,Meter,Nav,NoScript,Object,Ol,OptGroup,Option,Output,P,Picture,Pre,Progress,S,Samp,Scarfold,Search,Section,Select,Small,Span,Strong,Sub,Summary,Sup,Svg,Table,TBody,Td,Template,TextArea,TFoot,Th,THead,Time,Tr,U,Ul,Var,Video,Wbr
-
Field Summary
FieldsFields inherited from class webx.WebXElement
attributes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadd(WebXElement child) Appends a child to the parent classadd(WebXElement... children) Appends multiple child nodes to the parent at once.addChild(WebXElement child) Deprecated.addChildren(WebXElement... children) Deprecated.Adds an attribute to the elementThe class global attribute is a list of the classes of the element, separated by ASCII whitespace.hxBoost(boolean activate) The hxBoost attribute allows you to “boost” normal anchors and form tags to use AJAX instead.The hxConfirm method allows you to confirm an action before issuing a request.Submits a file uploaded via a form to the server.hxEncoding(String type) Submits a file uploaded via a form to the serverThe hxExt attribute enables an htmx extension for an element and all its children.The hxGet method will cause an element to issue a GET to the specified URL and swap the HTML into the DOM using a swap strategyThe hxOn method allow you to embed scripts inline to respond to events directly on an element; similar to the onevent properties found in HTML, such as onClick.The hxPost method will cause an element to issue a POST to the specified URL and swap the HTML into the DOM using a swap strategyhxSend()Sends a message to the nearest websocket based on the trigger value for the elementThe hx-swap attribute allows you to specify how the response will be swapped in relative to the target of an AJAX request.The hx-swap-oob attribute allows you to specify that some content in a response should be swapped into the DOM somewhere other than the target, that is “Out of Band”.The hx-target attribute allows you to target a different element for swapping than the one issuing the AJAX request.The hx-trigger attribute allows you to specify what triggers an AJAX request.The hx-vals attribute allows you to add to the parameters that will be submitted with an AJAX request.The WebSockets extension enables easy, bi-directional communication with Web Sockets servers directly from HTML.The id global attribute defines an identifier (ID) which must be unique in the whole document.render()Converts the Any webx element into its html representation, including all its children, recursively.
-
Field Details
-
children
-
-
Constructor Details
-
WebXContainerElement
public WebXContainerElement()
-
-
Method Details
-
addChildren
Deprecated.Appends multiple child nodes to the parent at once.- Parameters:
children- Comma separated list of children or an array of child nodes- Returns:
- A modified element
-
add
Appends multiple child nodes to the parent at once.- Parameters:
children- Comma separated list of children or an array of child nodes- Returns:
- A modified element
-
add
Appends a child to the parent class- Parameters:
child- The actual child node- Returns:
- A modified element
-
addChild
Deprecated.Appends a child to the parent class- Parameters:
child- The actual child node- Returns:
- A modified element
-
attr
Description copied from class:WebXElementAdds an attribute to the element- Overrides:
attrin classWebXElement- Parameters:
key- The attribute identifier or namevalue- The attribute value- Returns:
- A modified element
-
render
Description copied from class:WebXElementConverts the Any webx element into its html representation, including all its children, recursively.- Specified by:
renderin classWebXElement- Returns:
- The String representation of the element along with the children.
-
hxVals
Description copied from class:WebXElementThe hx-vals attribute allows you to add to the parameters that will be submitted with an AJAX request.- Overrides:
hxValsin classWebXElement- Parameters:
val- Custom data to be send to the server along with the request. Useful when sending post requests.- Returns:
- A modified element
- See Also:
-
hxPost
Description copied from class:WebXElementThe hxPost method will cause an element to issue a POST to the specified URL and swap the HTML into the DOM using a swap strategy- Overrides:
hxPostin classWebXElement- Parameters:
path- Server endpoint to make the request to- Returns:
- A modified element
- See Also:
-
hxGet
Description copied from class:WebXElementThe hxGet method will cause an element to issue a GET to the specified URL and swap the HTML into the DOM using a swap strategy- Overrides:
hxGetin classWebXElement- Parameters:
path- Server endpoint to make the request to- Returns:
- A modified element
- See Also:
-
hxSwapOob
Description copied from class:WebXElementThe hx-swap-oob attribute allows you to specify that some content in a response should be swapped into the DOM somewhere other than the target, that is “Out of Band”. This allows you to piggy back updates to other element updates on a response.- Overrides:
hxSwapOobin classWebXElement- Parameters:
value- Activation (true) or a swap strategy- Returns:
- A modified element
- See Also:
-
hxBoost
Description copied from class:WebXElementThe hxBoost attribute allows you to “boost” normal anchors and form tags to use AJAX instead.- Overrides:
hxBoostin classWebXElement- Parameters:
activate- The boolean value used to enable or disable the boost- Returns:
- A modified element
- See Also:
-
hxConfirm
Description copied from class:WebXElementThe hxConfirm method allows you to confirm an action before issuing a request. This can be useful in cases where the action is destructive and you want to ensure that the user really wants to do it.- Overrides:
hxConfirmin classWebXElement- Parameters:
message- Text to be used as a confirmation message- Returns:
- A modified element
- See Also:
-
hxOn
Description copied from class:WebXElementThe hxOn method allow you to embed scripts inline to respond to events directly on an element; similar to the onevent properties found in HTML, such as onClick. The hx-on* attributes improve upon onevent by enabling the handling of any arbitrary JavaScript event, for enhanced Locality of Behaviour (LoB) even when dealing with non-standard DOM events- Overrides:
hxOnin classWebXElement- Parameters:
event- Event which triggers the requests- Returns:
- A modified element
- See Also:
-
hxExt
Description copied from class:WebXElementThe hxExt attribute enables an htmx extension for an element and all its children. The value can be a single extension name or a comma separated list of extensions to apply. The hxExt tag may be placed on parent elements if you want a plugin to apply to an entire swath of the DOM, and on the body tag for it to apply to all htmx requests.- Overrides:
hxExtin classWebXElement- Parameters:
ext- The extension to be used- Returns:
- A modified element
- See Also:
-
hxWs
Description copied from class:WebXElementThe WebSockets extension enables easy, bi-directional communication with Web Sockets servers directly from HTML.- Overrides:
hxWsin classWebXElement- Parameters:
url- Url for the websocket server- Returns:
- A modified element
- See Also:
-
hxSend
Description copied from class:WebXElementSends a message to the nearest websocket based on the trigger value for the element- Overrides:
hxSendin classWebXElement- Returns:
- A modified element
- See Also:
-
hxEncoding
Description copied from class:WebXElementSubmits a file uploaded via a form to the server- Overrides:
hxEncodingin classWebXElement- Parameters:
type- The type of encoding which must be used. Note custom encoding formats are not yet supported for now.- Returns:
- A modified element
- See Also:
-
hxEncoding
Description copied from class:WebXElementSubmits a file uploaded via a form to the server. Sets the the type to "multipart/form-data"- Overrides:
hxEncodingin classWebXElement- Returns:
- A modified element
- See Also:
-
hxSwap
Description copied from class:WebXElementThe hx-swap attribute allows you to specify how the response will be swapped in relative to the target of an AJAX request. If you do not specify the option, the default is htmx.config.defaultSwapStyle (innerHTML).- Overrides:
hxSwapin classWebXElement- Parameters:
strategy- The swap strategy to be used- Returns:
- A modified element
- See Also:
-
id
Description copied from class:WebXElementThe id global attribute defines an identifier (ID) which must be unique in the whole document. The purpose of the ID attribute is to identify a single element when linking (using a fragment identifier), scripting, or styling (with CSS). Elements with ID attributes are available as global properties. The property name is the ID attribute, and the property value is the element.- Overrides:
idin classWebXElement- Parameters:
id- The identifier for the element- Returns:
- A modified element
- See Also:
-
hxTarget
Description copied from class:WebXElementThe hx-target attribute allows you to target a different element for swapping than the one issuing the AJAX request.- Overrides:
hxTargetin classWebXElement- Parameters:
target- The target element to be replaced with the response html- Returns:
- A modified element
- See Also:
-
hxTrigger
Description copied from class:WebXElementThe hx-trigger attribute allows you to specify what triggers an AJAX request.- Overrides:
hxTriggerin classWebXElement- Parameters:
trigger- The event that triggers the http request- Returns:
- A modified element
- See Also:
-
className
Description copied from class:WebXElementThe class global attribute is a list of the classes of the element, separated by ASCII whitespace. Classes allow CSS and JavaScript to select and access specific elements via the class selectors or functions like the document.getElementsByClassName().- Overrides:
classNamein classWebXElement- Parameters:
names- Whitespace separated list of classes- Returns:
- A modified element
- See Also:
-