-
Notifications
You must be signed in to change notification settings - Fork 71
WebComponents
The Seaside WebComponents allows Seaside components to be embedded in non-Seaside web pages or web applications using Web Components.
To use a Seaside Web Component a web page or web application needs to include the JavaScript library from WAWebComponentsLibrary >> #seasideWebComponentsJs
and then use the <wa-component>
tag.
<html>
<head>
<!-- -->
<script src="seaside-components.js" defer></script>
</head>
<body>
<!-- -->
<wa-component url="/examples/headless-counter">Loading...</wa-component>
<!-- -->
</body>
</html>
The url
attribute of the <wa-component>
tag needs to point a Seaside application that only renders the HTML of a component without any <html>
, <head>
or <body>
elements. To achieve this the application can use WAFragmentRenderPhaseContinuation
.
We recommend you use the default WAQueryFieldHandlerTrackingStrategy
session tracking strategy. This way every component will get its own session. As the components are embedded the user will not see the session key in the URL.
When an embeded component does a full page refresh a full page refresh of the containing page will result. If this is not wanted then the component needs to use Ajax or opt-in to ajaxification.
Per default no ajaxification will happen so you have to make sure your component does not perform full page requests.
You can opt in to ajaxification using ajaxify="true"
<seaside-component url="/examples/headless-counter" ajaxify="true">Loading...</seaside-component>
The Seaside-WebComponents-Examples
package shows you how can put all these things together.
If you want to embed Web Components in Seaside applications we offer support for the <template>
and <slot>
elements as well as the slot
attribute. You can then use the Canvas API to render the custom markup the specific component requires.
(html tag: 'sl-alert')
attributeAt: 'open' put: true;
with [
(html tag: 'sl-icon')
slot: 'icon';
attributeAt: 'name' put: 'info-circle'.
html text: 'This is a standard alert. You can customize its content and even the icon.' ]
Changelogs
- (newer changelogs, see https://github.com/SeasideSt/Seaside/releases)
- 3.4.0
- 3.3.0
- 3.2.4
- 3.2.2
- 3.2.1
- 3.2.0
- 3.1.3
- 3.1.2
- 3.1.1
- 3.1.0
- 3.0.11
- 3.0.9
- 3.0.8
- 3.0.7
- 3.0.6
- 3.0.5
- 3.0.4
- 3.0.3
- 3.0.2
- 2.8
- 2.7
- Past Releases
Development
Documentation
- Configuration and Preferences
- Embedding Subcomponents
- Maintaining State
- Generating HTML
- CSS and Javascript
- Debugging Seaside Applications
- Links, Forms and Callbacks
- Development Tools
- Call and Answer
- Naming URLs
- Security Features
- Securing Seaside Applications
- Seaside-REST
- Add-On Libraries
- Persistence
- Gettext
- FileLibrary
- The Render Tree
- PDF Generation
- Long-Term Issues
- Ajaxification
- Web Components
- Big Issues
Sprints