Monday, July 30, 2012
Flex - Combobox as Dropdownlist
Thursday, February 2, 2012
Flex - Crossdomain
Crossdomain is one of the points where developer has to suffer a lot. To make it simple I have some important points below, which will make developer bit relax on crossdomain concept.
To check for authentication on flex side: -
If Flex application want to communicate with server side, below code need to be added on Flex side.
Security.allowDomain("*");
Above lines will check for the permission form public domain.
What is Security.allowDomain: -
The primary purpose of calling the Security.allowDomain() method is to grant permission for SWF files in an outside domain to script the SWF file, calling the Security.allowDomain() method.
Specifying an IP address as a parameter to the Security.allowDomain(ipAdd) method does not permit access by all parties that originate at the specified IP address. Instead, it permits access only by a party that contains the specified IP address as its URL, rather than a domain name that maps to that IP address. For example, if the domain name www.example.com maps to the IP address 192.0.34.166, a call to Security.allowDomain("192.0.34.166") does not grant access to www.example.com.
You can pass the "*" wildcard to the Security.allowDomain() method to allow access from all domains. Because it grants permission for SWF files from all domains to script the calling SWF file, use the "*" wildcard with care.
Flash Player restriction for lower version than 9.0.124: -
Flash Player version 9.0.124: It no longer allows you to send custom HTTP headers to a remote host. Example: a SWF from “Domain A” wants to send custom HTTP headers in a GET/POST request to “Domain B”. By default, starting with Flash Player 9.0.124 this won't work!"
As we are using both web service and HTTP service (method="GET") call to get data from server
crossdomain.xml format: -
File Name should be: - crossdomain.xml
How swf behaves with crossdomain file: -
When a SWF file attempts to access data from another domain, Flash Player automatically attempts to load a policy file from that domain. If the domain of the SWF file that is attempting to access the data is included in the policy file, the data is automatically accessible.
By default, policy files must be named crossdomain.xml and must reside in the root directory of the server.
A policy file affects access only to the particular server on which it resides.
Why “*”:-
Wildcard domains are indicated by either a single asterisk (*), which matches all domains and all IP addresses.
Where do the policy files need to reside XML web server
Policy files must be named crossdomain.xml and must reside in the root directory of the server.
One more important point: -
Check Firewall Security [internal and external access to port] which block user to access port.
Thanks for reading post…….
Thursday, November 17, 2011
Issue with custom Item renderer data repainting or data change automatically after focus out
There are lot of developer who creates custom Item renderer and place logic in side it, but lot of developer make small and common mistakes while creating custom component or custom item renderer.
If developer is overriding function he/she should take care of adding line
super.functionName(Par[..])
Example: -
override public function set data(value:Object):void
{
super.data = value;
//Developer Logic start below……
}
If developer forgot to write super in his override function above issue occurs where developer spend lot of time to find out the solution in written logical code.
Enjoy............
Friday, October 29, 2010
“No Response” Display Issue in TitleBar of your AIR Project.
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.
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
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.
Saturday, June 19, 2010
Issue Using (Native) Windows or Detached Window with AIR:-
Create custom component which contains Combobox and Datagrid.
Application conations two button 1) Same Window and 2) New Window. (Label of two button)
When you click on “Same Window” button your custom component should get added dynamically in your application.
And when you click on “New Window” button your custom component should get open in different window (it should get shifted from application and should appear in Window component).
Issue faced:-
Issue with DataGrid in Native window (AIR).
DataGridEvent.COLUMN_STRETCH event get affected if try to open datagrid in Native Window.
DataGridEvent get fired but takes long time or even stuck while column stretch
Tooltips all show up in the main application window rather than the popped up window by using mx:Windows and mx:WindowedApplication.
Note:
Application is a Desktop Application. Only one instance is created in Application for your custom component to preserve current state on your custom component it can be Style, data, or other subcomponent state of your custom component (as above mentioned 2 component are just sample).
Solution 1: - There is no real fix to this issue. You can recreate the component in the pop up window.
It is a heavy on performance.
Solution 2: - Use “Object polling Design Pattern” which will help you to overcome performance issue.
Welcome with good solution for this issue.