This is what I first believed too, but after some tests, I've noticed that when I don't specify a property attribute in my <display:column> tag, the Object inSjc is null. 
It is only filled by a property of the current row object when my <display:column > tag has a property attribute set.

Unfortunately for me, I do need more than 1 property of my object, so I need to get the current object as a whole, not just a property.
This is why I think I have to rely on UID to get the whole current row object.

I think I have understood something wrongly, but I really can't put a finger on it...

Stéphane


On 8/10/06, [EMAIL PROTECTED] < [EMAIL PROTECTED]> wrote:
oh, yes. you're right. I hadn't noticed that it is deprecated.
Anyway, I think the object you want is the first parameter of the method:
 
public Object decorate(Object inSJC, PageContext inPc, MediaTypeEnum 
inMte) throws DecoratorException
 
In the javadoc says that it is the "object to decorate".
regards,
Miro
-----Original Message-----
From: Stéphane Josephy [mailto:[EMAIL PROTECTED]]
Sent: donderdag 10 augustus 2006 11:43
Subject: Re: [displaytag-user] uid: row object not updated?

Thanks for your help.  However, I don't implement ColumnDecorator because it is apparently deprecated in DisplayTag 1.1.
I implement the DisplaytagColumnDecorator instead, as advised in the javadoc, which also has a decorate method, with the signature I mentioned.

Perhaps my problem would work with ColumnDecorator, but I'm not too hot about using a deprecated method...


Stéphane

On 8/10/06, [EMAIL PROTECTED] < [EMAIL PROTECTED]> wrote:
 
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.
 
 
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




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



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