0

I have list for which data is coming as below (3 elements with status as ABC and 2 elements with status as PQR). I am able to display data in table format using forEach.

a:test1:test2:ABC
a:test1:test2:PQR
a:test1:test2:ABC
a:test1:test2:PQR
a:test1:test2:ABC

I want to segregate/filter out the elements of list based on status field(PQR/ABC) and display in different table. Code for display all data in single table in jsp file as below:

<dsp:droplet name="/atg/dynamo/droplet/ForEach">
    <dsp:param name="array" param="testData" />

<dsp:oparam name="empty">
    No data.
  </dsp:oparam>

  <dsp:oparam name="outputStart">
    Here is the list of data displayed in table format: <br/>
  </dsp:oparam>

<table style="width:100%">
  <tr>
    <th>data1</th>
    <th>data2</th>
    <th>data3</th>
    <th>status</th> 

  </tr>
<dsp:oparam name="output">
<tr>
    <td>dsp:valueof param="element.data1"/>/</td>
    <td>dsp:valueof param="element.data2"/></td> 
    <td>dsp:valueof param="element.data3"/></td>
    <td>dsp:valueof param="element.status"/></td>
</tr>
 </dsp:oparam>
    </dsp:droplet>
Manan Kapoor
  • 675
  • 1
  • 11
  • 28

1 Answers1

0

There are multiple ways to achieve this task.

  1. You can use two different lists in FormHandler and in JSP iterate it when you need to show.
  2. You can create one droplet and pass this array to the droplet. In droplet, you can create two different lists or segregate/filter out logic and use accordingly in JSP.

Hope this help.

Anshu Kumar
  • 633
  • 7
  • 12