You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Jonny Wray <jo...@yahoo.com> on 2004/04/12 20:51:21 UTC

Null values in table

Hi,

I have the situation where I'm populating a table cell with values from
a map with a fixed key. The ognl expression is something along the
lines of a.b.c where b is a map and c the key I'm interested in. a is
the object to be displayed in a specific row of the table. However,
some of the maps are not complete, and when that is the case b.c will
throw a OgnlException. This is causing me problems:

i) When the object c is a string, I get an logged error message but the
table displayed fine.

ii) If c is not a string then I get a class cast exception when trying
to sort the column.

I've tracked this down to the following code from
OgnlTableColumnEvaluator class in the table contrib code:

  try
  {
	Object objValue = Ognl.getValue(m_objParsedExpression, objRow);
	return objValue;
  }
  catch (OgnlException e)
  {
	LOG.error(
	"Cannot use column expression '" + m_strExpression + "' in row",
				e);
	return "";
  }

So, the code effectively will log an error and return an empty string
if an ognl exception is thrown. If the column should be another class
this causes the ClassCastException. 

Has anyone else encountered this problem? Potential solutions?

thanks,

Jonny


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org