Parameters

You may define parameters within your panel definitions using the <param> element. The <param> element takes a mandatory name attribute and an optional value attribute. The name attribute values must be unique under the <panel>'s <param> children. The optional value attribute defines the parameter value.

Omitting the value attribute leaves the parameter value undefined. Accessing an undefined parameter value will cause an exception to be thrown. Undefined parameters should be overridden by derived panels or specified by the template during inclusion using a dynamic parameter. Use value="${null}" to specify value null.

The parameters of the current panel are accessible by templates using a Calyxo accessor.

Consider the following example:

<panel name="..." template="/foobar.jsp">
  ...
  <param name="foo" value="hi!"/>
  <param name="bar"/>
  ...
</panel>

Dynamic parameters

It is also possible to specify dynamic parameters during panel inclusion. A template uses the <param> tag inside a <panel> tag like this:

<jsp:root version="2.0"
  xmlns:panels="http://calyxo.odysseus.de/jsp/panels"
  xmlns:jsp="http://java.sun.com/JSP/Page">
  ...
  <panels:panel name="/button">
    <panels:param name="label" value="Save"/>
    <panels:param name="name" value="save"/>
  </panels:panel>
  ...
</jsp:root>

During instantiation of an included panel, dynamic parameters are added to its namespace, overriding static parameter definitions from the panel's configuration.