Flex 4 Loader having status with Data Service
I have been working on a flex application with java, as i have used Life Cycle Data Service for communication, i wana know, is there any function of flex, where i can see the loading st开发者_JAVA百科atus in percentage, that how much record is being loaded.
Problem is, if there is lengthy record, no body comes to know, whats happening with software, like in Comboboxes or Grids, users usually think it as a BUG in application, but ofcourse it is not.
I need such graphical loader, which keeps on loading with proper status in percentage, until it receives all data from JAVA (SQL Server).
Kind regards Atif
Percentage loading is possible if you implement your own Socket protocol since you know exactly how many bytes are coming through, but that would be overkill for you. The best thing you can do is create a proper UX where there's a loading indicator that pops up until all the data has arrived.
I'll assume your using the SQL-Assembler?
There are a couple of things you can do to improve this. The first is to use the paging feature of the SQL-Assembler. (LCDS Developer guide - Data paging) This will at least return the first # of pages you specifiy in the configuration files back more quickly. Also make sure you change any filtering of the collection to not do this in Action script but to call another fill function to return different results. The way LCDS sql-assembler works with paging is to leave a null in place of an object in the last element of the collection. Once that is referenced in action script LCDS knows to get the next page # amount of data.
One thing lacking in the SQL-assembler (as of LCDS 2.6) is a way to call a select statment with count so you can display how many results will return from your fill function calls.
I worked around this by using a remote object to call an EJB 3 to call a count query. Then I display a (total length of Collection) of (remote count) number above my data grid for large query results.
精彩评论