I'm trying to build a table from an array of StartJobCard, an in-house complex class.
I use DisplayTag 1.1 and JBOSS 4.0.2.
It goes like this:
<display:table name="startJobCards" uid="currentStartJobCard">
<display:column decorator="my.package.decorator.StartJobCardDecorator" />
</display:table>
As I understand it, the uid attribute allows me to get the object in the current row, using PageContext.
So, in my decorator, I do this:
+++++
public Object decorate(Object inSJC, PageContext inPc, MediaTypeEnum
inMte) throws DecoratorException {
String result = "";
Object sjc = inPc.getAttribute("currentStartJobCard");
if (sjc != null) {
if (!(sjc instanceof StartJobCard)) {
result = sjc.toString();
} else {
result = findStatus((StartJobCard) sjc, inPc);
}
}
return result;
}
+++++
inPc.getAttribute("startJobCard") 'almost' works, in the sense that I get a StartJobCard object indeed. I was happy, until I noticed that the object wasn't actually updated, and it was the same one for every row... (i.e., the object I get is always the last one from my array of StartJobCard objects.
Am I understanding the whole 'uid' thing correctly? If not, do you see a workaround, to get current row object in my decorator?
Many thanks in advance, and I hope I've been clear enough.
Stéphane
------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________ displaytag-user mailing list displaytag-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/displaytag-user