Mike wrote:
*I have most of the code you're referring to also, but the main problem
is that when I click the column, the setColumnName method in the bean
doesn't fire.
I'm also wondering about the value part of the table definition. It
seems to be OK, but I'm running out of things to look at.
Mine is: value ="#{TD.getPersons}"
And, the corresponding getPersons() method looks like this (and this one
is being called):
public List getPersons()
{
try
{
this.loadFromDB(); // loads the ArrayList from Database.
}
catch (SQLException e)
{
}
sort(getSortColumn(), isAscending());
_persons= arrayListData;
return _persons;
}
The value expression should be "#{TD.persons}" not "#{TD.getPersons}".
EL expressions take *property names* not *method names*.
Remember that a class can have a companion BeanInfo class that maps
property names onto any arbitrary methods on the class. It's only the
*default* behaviour that maps a property name "xyz" onto getXyz() and
setXyz(). This is why EL uses "property names", not "method names"; a
BeanInfo might override this default mapping.
The rest looks ok to me (though you're using too many class member
variables for my taste; where's loadFromDB storing its data? where do
arrayListData and _persons come from? What's the sort method doing? Not
clear here; using more params/return values would clarify this).
Regards,
Simon