This is a quick example to show how easy it is to use ExtWebComponents in your GXT application.
- ExtWebComponents.js - the Web Components source.
- FromTemplate.html - Where the Web Components are being used.
- Entry Point - It's important to note that the resources are loaded dynamically so the debugging can happen instantatly with out restarting the debugger.
There are two steps to use this project. First, create a GXT project if you don't already have one. Secondly, import and configure the ExtWebComponent usage.
Follow these steps to setup a bare bones GXT project.
-
Login to maven, using settings.xml.
-
Generate your a project with this.
mvn archetype:generate -DarchetypeGroupId=com.sencha.gxt.archetypes \
-DarchetypeArtifactId=gxt-basic-support-4x-archetype \
-DgroupId=com.projectname.project \
-DartifactId=sandbox-gxt-ewc \
-Dmodule=GxtEwcProject
Follow these three steps to add ExtWebComponents to your GXT Application.
-
Sign up for the ExtWebComponents Early Adopter. Or purchase it.
-
Login
npm login --registry=https://sencha.myget.org/F/early-adopter/npm/ --scope=@sencha
-
Create the package.json
{
"name": "ewc sandbox project",
"version": "1.0.0",
"description": "ext-web-components example",
"scripts": {},
"devDependencies": {
"@sencha/ext-web-components": "~7.1.0"
}
}
- Run
npm install
. This will download the dependencies used in the project.
This configuration uses the webcomponents with out a bundler. This means the javascript has to be copied to the webapp directory.
- Run
npm install
- this downloads the node_modules - Run
mvn resources:copy-resources
- this copys the node modules to the webapp folder. - Create an IDE launcher to run the project.
- Launch the GWT debugger.
- Make a code modification
- Reload the browser and the GWT compiler will recompile the changes.