Forum Moderators: open

Message Too Old, No Replies

Need to filter values in array

         

stewygenie

11:12 am on May 15, 2004 (gmt 0)

10+ Year Member



I have a question I was wondering if you have any idea on how to display only one row in java instead of two for an array.

right now in my UI Screen it displays 2 rows.

Sample:
Invoice# LineItem# Paid Date
1 1 5/1/2004
1 2 5/3/2004

I just need the latest date to be displayed and in order for this to be done. I have to get the maximum date of the Invoice.

Invoice# LineItem# Paid Date
1 2 5/3/2004

any help will be appreciated thanks!

Java or javascript will do. Thanks!

Bernard Marx

2:13 pm on May 15, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I think some code might help here!

Rambo Tribble

2:18 pm on May 15, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The line break is probably part of the existing code, so, as Mr. Marx suggests, posting the code would facilitate the process of analysis.

stewygenie

3:05 pm on May 15, 2004 (gmt 0)

10+ Year Member



im not sure where to start but here is where i get the array list

public void loadCbiHistoryList(String id)
{
PersistenceStrategy strategy = getPersistenceFrameworkHelper().getStrategy("rview");
ArrayList bcsCbiHistoryList;

BcsCbiHistory[] bcsCbiHistory = null;
Query query = new Query(BcsCbiHistory.class);
query.getCriteria().propertyEquals( "contactId", id);
query.getCriteria().propertyEquals( "activityType", "P");
try {
bcsCbiHistoryList = getRepositoryManager().fetchMany( query, strategy );
bcsCbiHistory = new BcsCbiHistory[bcsCbiHistoryList.size()];
bcsCbiHistory = (BcsCbiHistory[])bcsCbiHistoryList.toArray(bcsCbiHistory);
setBcsCbiHistory(bcsCbiHistory);
}
catch ( PersistenceException e )
{
addErrorMessage("Problem trying to load user and vendor data! " + e);
}
}

This is how I display the values.

<DROPLET BEAN="Range">
<PARAM NAME="array" VALUE="bean:BcsCbiHistoryForm.bcsCbiHistoryList">
<PARAM NAME="sortProperties" VALUE="-cbiId -">
<PARAM NAME="howMany" VALUE="bean:BcsCbiHistoryForm.cbiHistoryCount">
<PARAM NAME="elementName" VALUE="bcscbihistory">
<OPARAM NAME="empty">
<TR><TD CLASS="pageTXT" COLSPAN="8" ALIGN="center">No Records Found.</TD></TR>
</OPARAM>
<OPARAM NAME="output">
<TR>
<TD CLASS="bcs_reportListItem"><A HREF="/admin/bcs/bcs_cbi_detail.jhtml" BEAN="BcsCbiHistoryForm.openCbiDetailPage">
<PARAM NAME="cbiId" VALUE="param:bcscbihistory.cbiId">
<VALUEOF PARAM="bcscbihistory.cbiId">&nbsp;</VALUEOF></A></TD>
<TD CLASS="bcs_reportListItem"><VALUEOF PARAM="bcscbihistory.cbiCreationDtm" date="M/dd/yyyy">&nbsp;</VALUEOF></TD>
<TD CLASS="bcs_reportListItem">$<VALUEOF PARAM="bcscbihistory.amountDue" number=#.00>&nbsp;</VALUEOF></TD>
<TD CLASS="bcs_reportListItem">$<VALUEOF PARAM="bcscbihistory.cbiPayments" number=#.00>&nbsp;</VALUEOF></TD>
<TD CLASS="bcs_reportListItem"><VALUEOF PARAM="bcscbihistory.paymentReceived" date="M/dd/yyyy">&nbsp;</VALUEOF></TD>
<TD CLASS="bcs_reportListItem"><VALUEOF PARAM="bcscbihistory.cbiStatus">&nbsp;</VALUEOF></TD>
</TR>
</OPARAM>
</DROPLET>

Thanks!