headerCell.setSortName(this.sortName);
// href and parameter, create link
if (this.href != null)
{
Href colHref;
// empty base url, use href with parameters from parent table
if (StringUtils.isEmpty(this.href.getBaseUrl()))
{
colHref = (Href) tableTag.getBaseHref().clone();
}
else
{
colHref = (Href) this.href.clone();
}
if (this.paramId != null)
{
// parameter value is in a different object than the iterated one
if (this.paramName != null || this.paramScope != null)
{
// create a complete string for compatibility with previous version before expression evaluation.
// this approach is optimized for new expressions, not for previous property/scope parameters
StringBuffer expression = new StringBuffer();
// append scope
if (StringUtils.isNotBlank(this.paramScope))
{
expression.append(this.paramScope).append("Scope.");
}
// base bean name
if (this.paramId != null)
{
expression.append(this.paramName);
}
else
{
expression.append(tableTag.getName());
}
// append property
if (StringUtils.isNotBlank(this.paramProperty))
{
expression.append('.').append(this.paramProperty);
}
// evaluate expression.
// note the value is fixed, not based on any object created during iteration
// this is here for compatibility with the old version mainly
Object paramValue = tableTag.evaluateExpression(expression.toString());
// add parameter
colHref.addParameter(this.paramId, paramValue);
}
else
{
// set id
headerCell.setParamName(this.paramId);