Hi,
 
do you implement the interface "ColumnDecorator" ?
I guess not because the signature of your decorate method does not match the signature of the decorate method of the ColumnDecorator.
If you use that interface, the object representing the current row is given as argument to the decorate.
 
Check the javadocs of that interface at: http://displaytag.sourceforge.net/11/displaytag/apidocs/index.html
 
regards,
Miro
-----Original Message-----
From: Stéphane Josephy [mailto:[EMAIL PROTECTED]
Sent: donderdag 10 augustus 2006 11:11
To: displaytag-user@lists.sourceforge.net
Subject: [displaytag-user] uid: row object not updated?

Hi all 
 
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

Reply via email to