MetalJS’s component class, which your view component extends, extends MetalJS’s state class. The state class provides a STATE object that contains state properties, as well as watches these properties for changes. Any template parameters defined in your portlet classes are automatically added as properties to the portlet’s STATE object. The component class provides additional rendering logic, such as automatically re-rendering the component when the state class detects a change in a state property. This means that you can change a state property on the client-side and automatically see that change reflected in the component’s UI!

This section of tutorials covers how to configure and use your Soy portlet’s STATE object.

Understanding The State Object’s Architecture

An example STATE object configuration appears below: View.STATE { myStateProperty: { setter: 'setterFunction', validator: val => val === expected value, value: default value, valueFn: val =>...

Read More

Configuring Portlet Template Parameter State Properties

Portlet template parameters are added automatically as state properties to the view component’s STATE object. Therefore, you can provide additional configuration options for them in the STATE...

Read More

Configuring Soy Portlet Template Parameters on the Client Side

Portlet template parameters are set in the Soy Portlet’s server-side code. MetalJS’s state class provides a STATE object that exposes these parameters as properties so you can access them on the...

Read More
0 (0 Votes)
Creating a Soy Portlet Previous