How can I get rid of duplicates ? ? ?

X-Application Version: 3.1.1
Tamino Version : 3.1.1
Platform : NT
WebContainer : Tomcat 3.3a
JDK Version : 1.3.1

I am using the browse tag, to retrieve information, this is then displayed, but I need to get rid of the duplicate records.

Does anybody know how I can do this ? ? ?
or does anybody have any ideas ? ? ?
:confused:

<%@ page language=“java” contentType=“text/html; charset=ISO-8859-1”
import=“com.softwareag.xtools.xapplication.jsp.ServletSessionContext,
com.softwareag.xtools.xapplication.businessdocument.BusinessDocumentWorkspace,
java.util.HashSet”
%>

<%@ taglib uri=“404” prefix=“bdm” %>

<bdm:module id=“bdPropBrowse”>

<bdm:form module=“bdPropBrowse”>
<bdm:directcommand document=“persons” type=“query” schema=“Property” queryparm=“@ino:id>=1” />
</bdm:form>

<% HashSet sagsis = new HashSet();
BusinessDocumentWorkspace workspace = ServletSessionContext.getSessionContext(pageContext).getWorkspace();
%>




<bdm:browse module=“bdPropBrowse” document=“persons” pagesize=“1000”>
<% if (sagsis.add(workspace.lookup(“persons”).getDescendant(“/Property/Address/State”).getValue())) { %>







<% } %>
</bdm:browse>
Id Price Category State
<bdm:display select=“$ID” /> <bdm:display select=“/Property/Price” /> <bdm:display select=“/Property/@Category” /> <bdm:display select=“/Property/Address/State” />

</bdm:module>

Have a look for the code which is emphasized. At first, the required classes are imported: ServletSessionContext, BusinessDocumentWorkspace and HashSet. We use the HashSet to implement the check if documents are equal and we use the ServletSessionContext to get the BuisnessDocumentWorkspace. The workspace allows us to address the current document of the browse list. Within this example two documents are equal if they have the same state. With our HashSet we check if the state of the current document was already added by a former document. If yes, The document is not displayed (the add method of the HashSet returns false).

I hope, you can adapt this example to your application.

Bye Christian.

PS: It is possible to adapt the code also for a loop tag.