SSmartLite Academy
0 pts
Trail MapTrailsIndustriesUse CasesComponents
Appearance
Your points 0 pts

Introduction

What are SmartLite Components?

SmartLite Components are how you build your own screens and record-page panels in SmartLite. A component is a small bundle of files: a template for the layout, a JavaScript controller for clicks and typing, and optional styles. Your Custom Classes do the real work on the server, and the component shows what they return.

Overview #

You write three kinds of code, and each has one job:

PartRunsJob
Custom Class (Groovy)On the serverReads and saves records, applies your rules, works out totals and labels, and decides what the user may do.
Template (.html)In the browserThe layout: shows values with {name}, repeats rows, shows and hides parts, connects buttons.
Controller (.js)In the browserHolds what the class returned and reacts to the user. Usually a few short methods.

The recommended pattern is simple: the class computes, the component shows. A class method returns everything a screen needs, ready to display. Every button calls another class method that does the work and returns the updated screen. Your rules live in one place, and the component stays small.

Where a component can go #

  • As an app page, with its own address /c/dealDesk that you can put on a tab.
  • On a record page, placed with the Page Layout Editor, where it knows which record it is on.
  • Inside another component, as a tag like <c-contact-card>. Every component can be used this way.

Built on web standards

Every component is a real custom element with its own shadow DOM, so its styles stay inside it. It runs in a sandboxed frame with no network access, and it can only reach the server through the class methods it imports.

Availability

Custom code is currently switched off in production while its sandbox is being strengthened. Components run wherever Custom Classes can run.