Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 2878

Populate Dropdown dynamically and remove any duplicates

$
0
0

Hello Experts,

 

I was trying with having a dropdown in my application. Below code I have written in my xml view:

 

<contentLeft>

  <Select id="filterSelect" change="handleFilter" selectedKey="none"

  autoAdjustWidth="true" items="{/ExFdetailsSet}">

  <core:Item key="{Year}" text="{Year}" />

  </Select>

</contentLeft>

 

Here ExFdetailsSet will contain my flight details, this will have an attribute named 'Year', so I want to display Year in my drop down dynamically based on my flight information. This works but unfortunately it shows all the year for e.g if my flight list contains 50 records for which I have both year as 2015 / 2016 then in my drop down I can see both the year but in a repetitive manner.

 

But I want to show only key records by removing duplicates: means only two values should come in my drop down, 2015 and 2016. Also I don't want any default year selection for which I have used selectedKey="none", but seems, it doesn't work.

 

Could someone help me in this regards.

 

Thanks, SL


Viewing all articles
Browse latest Browse all 2878

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>