on 2007 Dec 20 12:31 PM
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
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!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
66 | |
10 | |
10 | |
10 | |
10 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.