You need to sign in to do that
Don't have an account?
henryCH
Flex: QueryResultIterator
Hello everybody,
I'd like to display a pop-up window with a progress bar on it, while larger amounts of data is retrieved by the QueryResultIterator but I can't find out when exactly the asynchronous QueryResultIterator finishes. So I also don't know when the pop-up window can be removed. Any suggestions??
Thanks and best regards,
Henry
I'd like to display a pop-up window with a progress bar on it, while larger amounts of data is retrieved by the QueryResultIterator but I can't find out when exactly the asynchronous QueryResultIterator finishes. So I also don't know when the pop-up window can be removed. Any suggestions??
Thanks and best regards,
Henry
Code:
Message Edited by henryCH on 06-13-2007 09:24 AM
the QUERY_EVENT will be send for each batch, not at the end of the last batch.
you may be removing the wait window too soon.
the callback really needs access to the queryResult.done flag.
i'll look at re-writing this iterator to look more like the ajax version.
until then you can modify your library and pass the QR to your call back,
here is what i'm thinking of (inside queryMoreProcessBatch() ), note this passes the record and the full result to allow lookahead or insight into the value of qr.done.
Code:
also this method could send another event on "really done";
thanks for the response. I think I ran into another problem with QueryResultIterator. Whenever I tried to execute an SOQL statement that returns 0 records a TyperError caused by a null reference is thrown. So I checked the code and it seems that the case of zero records was not checked:
Code:
I'm not sure if this is a bug, so please advise.
Thanks and best regards,
Henry
I should be able to put out a new library with a fix next week.
the problem with handling the QUERY_EVENT was that the event is triggered before the records are processed, so at the time the query was completed the foreach-Function has not been started. I think it's really necessary to know when the whole query/queryMore process finished so I added another QueryEvent type: QUERY_DONE to the QueryEvent class, which is fired at the following postition in the QueryResultIterator class:
Code:
This finally seems to work, but I think it's a kind of a dirty hack. So do you think there will be an indicator for the completion of the query process in future versions?
Thanks again and best regards
Henry
thanks in advance
TypeError: Error #1009: Cannot access a property or method of a null object reference.
on queries with 0 record results.
Thanks,
hey ron,
i just had a look at the latest release of the flex toolkit and i think the issue has already been fixed:
Code:
...
Best regards,
Henry