private String getRecordKey()
{
if ((record instanceof Record)==false)
return null; // not supported
// find Action
Record rec = (Record)record;
if (rec.isValid()==false)
{ log.error("Unable to detect record key. Record supplied is not valid!");
return null;
}
Object action = this.pageContext.getRequest().getAttribute("action");
if (action instanceof ActionBase)
{
return ((ActionBase)action).getRecordKeyString(rec);
}
// Assemble
StringBuffer key = new StringBuffer();
Column [] keyCols = rec.getKeyColumns();
for (int i=0; i<keyCols.length; i++)
{
if (i>0)
key.append("/");
key.append(StringUtils.valueOf(rec.getValue(keyCols[i])));
}
return key.toString();
}