📄️ App Context
contexts.appContext is a shared data store scoped to the whole application session. It's created once when the application loads and stays alive as the user navigates between pages, unlike pageContext (cleared when you navigate to a different page) or formContext (cleared when a form closes). Use it to share a value across unrelated pages and forms in the same session, such as a setting or flag that several different screens need to check.
📄️ Canvas Context
contexts.canvasContext gives your script code information about the device and canvas size the form is currently being displayed in. Use it when a component needs to behave differently depending on whether it's shown on a desktop, tablet, or mobile screen.
📄️ Form Context
Form Context is a storage area scoped to a single form instance. Use it to hold temporary data that components on that form need to share with each other, without saving it to the form's own data or to the backend. When the form closes, its Form Context and everything stored in it are cleared.
📄️ Page Context
contexts.pageContext is a data store scoped to the current page. Shesha creates one page context when a page opens, and everything on that page, the page's main form as well as any subforms, modal dialogs, form cells, or data list items rendered inside it, shares that same store. Use it to pass a value between forms on the same page without wiring up component-to-component bindings. When the user navigates away from the page, its page context and everything stored in it is cleared.
📄️ Web Storage
contexts.webStorage gives your form's script code access to the browser's storage, sessionStorage and localStorage. This lets a form remember small pieces of information between page reloads, or share a value between forms open in the same browser tab, without needing a round trip to the server.
📄️ Component Context
Some form components expose their own data, and in some cases an API of actions, as a named entry in the contexts object, alongside the standard contexts like application and webStorage. Not every component has one - check the context list in the script editor to see what's available for the components on your form.