Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Added note about what happens when an informal parameter is bound to null

...

Section
Column
Code Block
xml
xml
titleThis is right
<img src="${context:images/banner.png}"/>
Column
Code Block
xml
xml
titleThis is wrong
<img src="context:images/banner.png"/>

Informal Parameters

Main Article: Supporting Informal Parameters

Many Some components support informal parameters, additional parameters beyond the formally defined parameters. Informal parameters will be rendered into the output as additional attributes on the tag rendered by the component. Generally speaking, components that have a 1:1 relationship with a particular HTML tag (such as <TextField> and <input> will support informal parameters.

...

The default binding prefix for informal parameters depends on where the parameter binding is specified. If the parameter is bound inside a Java class, within the @Component annotation, then the default binding prefix is "prop:". If the parameter is bound inside the component template, then the default binding prefix is "literal:". This reflects the fact that a parameter specified in the Java class, using the annotation, is most likely a computed value, whereas a value in the template should simply be copied, as is, into the result HTML stream.

Informal parameters (if supported) are always rendered into the output unless they are bound to a property whose value is null. If the bound property is null then the parameter will not be present at all in the rendered output.

If your component should render informal parameters, just inject the ComponentResources for your component and invoke the renderInformalParameters() method. See Supporting Informal Parameters for an example of how to do this.

...