cancel
Showing results for 
Search instead for 
Did you mean: 

HTMLB - Sort a Dropdownlist

Former Member
0 Kudos

Hi ,

I have this piece of codes in my Java iViews :

<hbj:dropdownListBox id="SUPERIOR_ID_NEW">

<% for (int i = 1; i <= ISR.getAdditionalDataLength("SUPERIOR_KEY"); i++) { %>

<hbj:listBoxItem key='<%= ISR.getAdditionalData("SUPERIOR_KEY",i) %>'

value='<%= ISR.getAdditionalData("SUPERIOR_LABEL",i) %>'

selected='<%= ISR.getSelected("SUPERIOR_ID_NEW","SUPERIOR_KEY",i) %>'

/>

<% } %>

</hbj:dropdownListBox>

It is showing a list of username in a drop down list.

Can I sort this HTMLB dropdownlist?

How do you do it? I have searched the HTMLB documentation but it does not tells you how to sort the list items in a drop down list.

Any help would be greatly appreciated.

Thanks.

Regards,

Mike Lee

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

You can find solution in this thread..

/thread/16767 [original link is broken]

Let us know is you find difficulties.

Regards,

Uma

Former Member
0 Kudos

Hi,

Try adding the values in ISR into Vector object. Sort the vector using Collections.sort() method. Add the sorted values in vector into the dropdownlistbox.

Hope this helps.

Regards,

Uma

Former Member
0 Kudos

Hi Uma,

Thanks for your reply.

Do you have a sample of adding the values into Vector object and sorting the vector?

Do hope to hear from you soon.

Thanks.

Regards,

Mike Lee