Friday, October 29, 2010

“No Response” Display Issue in TitleBar of your AIR Project.

Issue: If you are working on Air with huge load on your application like lot of DragDrop operation, moving component from here and there and performing lot of animation on your application which will lead to hang your application (stuck your application) but after some time it will work properly but issue is - you can find "No Response" will get displayed at TitleBar of your Application.

Solution: After R&D I found that there is property called applicationActivate in WindowedApplication which is used to solve your problem. Call below function to make your project name assigned to “title” of your application

private function applicationActivateHandler():void{
this.title = "ProjectName";
}

Print AdvancedDataGrid with property variableRowHeight related to page width.

While working on PrintAdvancedDataGrid component I found it is very interesting to do R&D on it. There is couple of issues I faced while working on it.

Issue: - If you are using PrintAdvancedDataGrid and property variableRowHeight is made as "true" you can find data is not getting print properly on page (i.e. percentWidth doesnot work (percentWidth = 100)).

Solution: To make it work properly you have to follow below steps: -

Steps: -
1) Assign data to dataProvider of your PrintAdvancedDataGrid
2) Assign percentWidth = 100
3) Call validateNow()
4) Assign percentHeight = 100
5) Assign variableRowHeight=true
6) Assign wordWrap=true

These six lines will solve your problem; these lines should be in same sequence as mentioned above.

It’s interesting to work on PrintAdvancedDataGrid Component and to do R&D on it. Enjoy…….

Importing more than 10000 records in AdvancedDataGrid issue

Consider you are getting 10000 records from server side in the form of XML and you have to display those records in Client side i.e. Flex AdvancedDataGrid.

It has been very critical to load more than 10000 records in Advanced DataGrid, there are many works around to solve this issue, after some workaround I found one of the solutions to load huge amount of data.

Difficulty faced during Debug this issue: -
1) Flex timeout: while debugging for 10000 and more records on client side.

Solution: After research I came to know that Flex gives timeout error after 2500 - 2900 records has been added in ArrayCollection which lead to Flex Timeout error.

If you are trying to load more records you have to create recursive function to handle it on client side.

setTimeout(recursiveImportHandler,200)

In recursiveImportHandler() function put “count” as variable which will keep track of record no.. Use “for loop” to add record in ArrayCollection.

Make your ArrayCollection as Bindable

Note: Your “count” should not be greater than your imported XML length.

To avoid user click you can provide Progress bar till your data gets loaded in AdvancedDataGrid.