Useful properties in combo:
prompt
displays a string when selectedIndex = -1
Thursday, June 12, 2008
Friday, April 04, 2008
how to get remoting to work if ColdFusion is deployed on the J2EE server (for example, Apache):
flex Project settings:
flex Server settings: root folder should point to the Application server root (say, C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\)
root url: http://localhost/ (whatever is defined as your root in the server's config, for apache, it is httpd.config)
flex compiler settings: add line:
-services "C:\ColdFusion8\wwwroot\WEB-INF\flex\services-config.xml". Tells where to look for services definitions. If you services-config.xml is elsewhere, point to that destination.
flex build Path:
should point to the output folder for your application under server root
(C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\HelloWorld_ro)
what to put in those folders:
after you compile the project, the HelloWorld_ro folder will contain the swf and html files generated for you by Flex.
CFC files should be in the server root dir (not in a folder though... still working on that), in my case - htdocs.
should work!
flex Project settings:
flex Server settings: root folder should point to the Application server root (say, C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\)
root url: http://localhost/ (whatever is defined as your root in the server's config, for apache, it is httpd.config)
flex compiler settings: add line:
-services "C:\ColdFusion8\wwwroot\WEB-INF\flex\services-config.xml". Tells where to look for services definitions. If you services-config.xml is elsewhere, point to that destination.
flex build Path:
should point to the output folder for your application under server root
(C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\HelloWorld_ro)
what to put in those folders:
after you compile the project, the HelloWorld_ro folder will contain the swf and html files generated for you by Flex.
CFC files should be in the server root dir (not in a folder though... still working on that), in my case - htdocs.
should work!
Wednesday, January 16, 2008
To go through an array one can use:
cfloop array=#MyArray# index="myIndex"
Wednesday, January 09, 2008
Scoping
Sometimes you need to catch events from an itemRenderer, but most likely you'll get "call to a possible undefined function" error. That is because the itemRenderer has a different scope than other objects on the page and does not see any of the page's code. Instead of using this:
you should use the following:
Sometimes you need to catch events from an itemRenderer, but most likely you'll get "call to a possible undefined function" error. That is because the itemRenderer has a different scope than other objects on the page and does not see any of the page's code. Instead of using this:
event="{eventHandler();}"
you should use the following:
event="{outerDocument.eventHandler();}"
Friday, November 09, 2007
If anyone wondered how to post XML pieces without browser trying to interpret it, here is a workaround solution.
I came to a point in my project when I had to query the database using a dynamic column name. It was easy to get the query right:
but it was tricky to print out the results of the query. After playing around with # signs and String functions, I searched for the solution online and discovered an
<cfquery name="myQuery" datasource="myDataSource">
SELECT #dynamic_column_name#
FROM #my_table_name#
</cfquery>
but it was tricky to print out the results of the query. After playing around with # signs and String functions, I searched for the solution online and discovered an
evaluate() function:
<cfloop query="getDetails">
<cfoutput>
<field>
#evaluate(column)#
</field>
</cfoutput>
</cfloop>
Tuesday, November 06, 2007
Colors in flex: converting strings to R, G, B triples and back
here
here
Wednesday, October 17, 2007
We all now that Flex is very much like Java. Do not forget then that in Java the expressions are evaluated from left to right. So, if you have an expression:
and
If
a = a && b;
and
a is false, b will not be looked at. This is important to remember in case when b is some expression and you want it to be evaluated no matter what a is:
a = a && anImportantUpdateFunction();
If
a is false, then anImportantUpdateFunction() will not be called.
Thursday, October 11, 2007
if using cfif tags, remember about the scope of defined variables (cfquery and such)
sometimes, out of the blue, you get this error message:
[RPC Fault faultString="HTTP request error" faultCode="Server.Error.Request" faultDetail="Error: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2032: Stream Error. URL: http://localhost/CFIDE/test_user/returncfml.cfm"]. URL: http://localhost/CFIDE/test_user/returncfml.cfm"]
at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::faultHandler()
at mx.rpc::Responder/fault()
at mx.rpc::AsyncRequest/fault()
at ::DirectHTTPMessageResponder/errorHandler()
at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/flash.net:URLLoader::redirectEvent()
Flex documentation< (need link) offers no explanation, one blog gives a short description. So what is it then?
- check if you have mistyped the URL (a page, your *.cfm file, etc)
- if you are pointing to a *.cfm, check that you are using the right Data Source to access the DB
- check if the Data Source connects to the DB you need
- check that your SQL query does what it is supposed to, i.e. does not insert rows w/o specifying primary key, or adding columns that do not exist in a table, etc.
[RPC Fault faultString="HTTP request error" faultCode="Server.Error.Request" faultDetail="Error: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2032: Stream Error. URL: http://localhost/CFIDE/test_user/returncfml.cfm"]. URL: http://localhost/CFIDE/test_user/returncfml.cfm"]
at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::faultHandler()
at mx.rpc::Responder/fault()
at mx.rpc::AsyncRequest/fault()
at ::DirectHTTPMessageResponder/errorHandler()
at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/flash.net:URLLoader::redirectEvent()
Flex documentation< (need link) offers no explanation, one blog gives a short description. So what is it then?
- check if you have mistyped the URL (a page, your *.cfm file, etc)
- if you are pointing to a *.cfm, check that you are using the right Data Source to access the DB
- check if the Data Source connects to the DB you need
- check that your SQL query does what it is supposed to, i.e. does not insert rows w/o specifying primary key, or adding columns that do not exist in a table, etc.
Subscribe to:
Posts (Atom)