cancel
Showing results for 
Search instead for 
Did you mean: 

dropdownbykey

0 Kudos

Hi,

I am using a dropdownbykey UI element to populate cities.

It has 1298 records in it and it takes about 8 sec to come up.

Is it normal?

If not, is there a way to decrease the upload time?

Here is the code:

ISimpleTypeModifiable modifiableSimpleType = attrInfo.getModifiableSimpleType();

IModifiableSimpleValueSet valueSet = modifiableSimpleType.getSVServices().getModifiableSimpleValueSet();

if (valuesNode.size() > 0) {

valuesNode.moveFirst();

IWDNodeElement currElem;

while (valuesNode.moveNext() != null){

currElem = valuesNode.getCurrentElement();

Object valueCode = currElem.getAttributeValue(fieldCode);

String valueText = currElem.getAttributeAsText(fieldText);

valueSet.put(valueCode,valueText);

}

}

valueSet.sort(true,true,true);

Regards,

Silvy

Accepted Solutions (1)

Accepted Solutions (1)

ankur_garg5
Active Contributor
0 Kudos

Hi Silvya,

As far my understanding goes, you cannot do much about it. 3-4 seconds is anyways normal. The reason for 8 seconds is primarily the complexity of your code.

You have a while loop which iterates for 1298 times, and once all the data is fetched, the sort() function after the loop sorts the entire 1298 items again.

All I can say is try modifying the code if possible.

Bye

Ankur

Do reward points for helpful as well as solved answers!!

Answers (0)