Your Ad Here

Friday, March 27, 2009

I'm sending my request, and I see the data traffic in the command window, but why is the result always

Question :I'm sending my request, and I see the data traffic in the command window, but why is the result always
empty?


Answer :You are probably trying to read the result immediately after the send(), right? You're expecting
synchronous behavior?

How do I get Flex to query my database

Question :How do I get Flex to query my database?
Answer :Flex does not have any native database integration functionality. You must have your own server-side
tier that provides the database-access tier and sends the data back to Flex through one of the
following protocols:
•RemoteObjects: This is the fastest. It communicates with server-side EJBs or POJOs using
AMF, a binary compressed format.
•HTTPService: This one uses the HTTP protocol. Sources can be JSP, ASPx, .NET, or any
URL that returns HTTP.
•WebService: This is the slowest. It uses the SOAP protocol. Sources can be .NET or any web
service.

myTree appears just fine but why can't I access the node attributes

Question :myTree appears just fine but why can't I access the node attributes?
Answer :Select a node in your myTree. In ActionScript, you can reference this node by using the following
code: myTree.selectedNode;
To access the attributes of the node, use the tree DataProvider API. These methods will work for
any format dataProvider item, which might be an object, array, or XML node.
The following example might work: myTree.selectedNode.attributes.myAttribute
But the following example is far more reliable:
myTree.selectedNode.getProperty("myAttribute");

When I add or modify an item in my dataProvider, why doesn't it show up in my DataGrid

Question :When I add or modify an item in my dataProvider, why doesn't it show up in my DataGrid?
Answer :Low-level methods like Array.push() or myArray[0] = "whatever" do not cause the
dataProvider's modelChanged event to fire.
When you work with a dataProvider, it is always best to use the dataProvider API. In the above
example, you might code: myDataProvider.addItem(myItemObject) to add an item or use
editField() to modify a value programmatically.
Alternatively, you can call myDataProvider.modelChanged yourself or reassign dataProvider to
the control, as follows: myDataGrid.dataProvider = myDataProvider;

Why is myTreeNode.label or myTreeNode.attributes.label undefined

Question :Why is myTreeNode.label or myTreeNode.attributes.label undefined?
Answer :Make sure you use the TreeDataProvider methods to modify a node. Don't rely on the node being
XML. For example, the above should be myTreeNode.getProperty("label") instead.

: Sometimes, if I don't move the mouse, "click" and "mouseDown" don't work. Why is that

Question :Sometimes, if I don't move the mouse, "click" and "mouseDown" don't work. Why is that?
Answer :This is a focus issue with Flash Player; usually when the UI changes "underneath" the mouse pointer,
as in a ViewStack navigation where the buttons are in the same screen location.

What does "The URL is not in the Proxy's whitelist" mean

Question :What does "The URL is not in the Proxy's whitelist" mean?
Answer :The whitelist is a security feature in Flex that requires you to define explicitly which URLs a data
service call can access.
You set this by editing the following file: ...\[flexroot]\WEB-INF\flex\flex-config.xml
There are three sections, one each for WebService, HTTPService, and RemoteObject. Be sure you
edit the correct section! Each has a subsection which contains nodes. To enable a URL for access by
a Flex dataService call, enter that URL between the tags.
For development phase only, you can allow global access with the wildcard rows. The flex-config
file is heavily commented. Open it up and you will see more detailed instructions there.
Your Ad Here