I have included two things below:

[1] The table definition as requested

[2] A snippet from a custom class that I wrote as explained next.

 

(Quick disclaimer:  I am using JAR 1.1.1 though I did try to drop test
the latest version of the JAR.   The rest of this email refers to the
source code which I got off one of the web source repositories, Koders
Search, and I have not done complete due diligence in reconciling
versions of code to JAR.)

So basically I feel that I have verified the behavior at least.  As my
original email states, it seems you can only use properties that belong
to the underlying object.  I guess that is fine for now as long as I
understand that.  It does not seem as useful but at least I know what to
expect.

 

So, for what it is worth, I have at least solved my problem temporarily
by writing a custom Decorator modeled after the total decorator in the
JAR.  I ended up overriding the evaluate method from the base Decorator
class which I included in [2] below.  It is pretty simple and it seems
to work though I have not done a lot of testing against it.  I will
update this thread if I find out more.

 

I am still curious as to the take that others have on this "feature".
My observations are not really a complaint, just trying to flush out my
own understanding and contribute to the process of open-source.  If I
get to spend much more time on this I may even post a proposed patch or
something. J

 

Thanks all.

 

Attachment 1:

[Note:  I know that these have a body and a property.  A mere artifact
of the various things I tried along the way.  From my testing,
apparently the property value trumps the tag body so it is merely
"misleading" and does not cause a bug.]

<display:table 

    htmlId="displaytable" 

    decorator="totalsDecorator"

    export="false" 

    requestURI="home.kpe" excludedParams="*"

    cellpadding="5px" cellspacing="0px"

    name="contractList" uid="contract" 

    >

    

    <display:column title="Contract"     sortable="false"
sortProperty="contractNo"><span
title="${contract.contractDesc}">${contract.contractNo}</span></display:
column>

    <display:column title="Deliv."       sortable="false"
class="alignRight"                            property="reviewTime"
total="true"
format="{0,number,integer}">${fn:length(contract.delivs)}</display:colum
n>

    <display:column title="Pending"      sortable="false"
class="alignRight borderLeft alertInfoBg"     property="projId"
total="true"
format="{0,number,integer}">${exp:getCountPendingDeliverables(contract)}
</display:column>

    <display:column title="Waiting"      sortable="false"
class="alignRight borderLeft alertMinorBg"    property="vendorId"
total="true"
format="{0,number,integer}">${exp:getCountWaitingDeliverables(contract)}
</display:column>

    <display:column title="Due"          sortable="false"
class="alignRight borderLeft alertMajorBg"    property="disciplineId"
total="true" format="{0,number,integer}">-</display:column>

    <display:column title="Late"         sortable="false"
class="alignRight borderLeft alertCriticalBg" property="assignedFl"
total="true"
format="{0,number,integer}">${exp:getCountLateDeliverables(contract)}</d
isplay:column>

    <display:column title="Received"     sortable="false"
class="alignRight borderLeft alertMinorBg"    property="leadId"
total="true"
format="{0,number,integer}">${exp:getCountReceivedDeliverables(contract)
}</display:column>

    <display:column title="Complete"     sortable="false"
class="alignRight borderLeft alertNormalBg"   property="altLeadId"
total="true"
format="{0,number,integer}">${exp:getCountCompleteDeliverables(contract)
}</display:column>

        

</display:table>

 

Attachment 2:

[Note: CheckedExceptionWrapper is a custom class that we use.]

    public Object evaluate(String name) {

        Object o = null; // super.evaluate(name);

        

        if (this.hasGetterFor(name)) {

            try {

                o = LookupUtil.getBeanProperty(this, name);

            } catch (ObjectLookupException e) {

                throw new CheckedExceptionWrapper(name, e);

            }

        } else {

            // else check underlining object

            o = super.evaluate(name);

        }

 

        return o;

    }

 

------------------------------------------------------------------------------
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
_______________________________________________
displaytag-user mailing list
displaytag-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/displaytag-user

Reply via email to