Prefix the value with @#
to
create new beans when required as shown in the following code example.
Creating a bean in a declaration
form {
date : "@#dateBean" ;
title : "CSS rules" ;
}
Subobject#dateBean {
class : ’java.util.Date’ ;
time : ’23849291’ ;
}
The @#
operator extends the
current data model by adding a dummy model object as the child of
the current object. The object ID of the dummy object is the remainder
of the string, beyond the @#
operator.
The type of the dummy object is Subobject
.
The dummy object inherits CSS classes and attributes from its parent.
The CSS engine creates and customizes a new subobject
according to the declarations it finds for the dummy object. This
means, in particular, that the Java class of the subobject is determined
by the value of the class
property. The
newly created subobject becomes the value of the @#
expression.
In the declarations for the subobject, attribute references through
the @
operator refer to the attributes
of the parent object.
Once the subobject is completed, the previous model is
restored so that normal processing is resumed.
In code example
Creating a bean in a declaration,
a
java.util.Date
object is created, with
the
time
property set to
23849291
.
This new object is assigned to the
date
property
of the
form
object.