Yet another busy day with Flex. Started the day with the intention of concentrating full time in Flex and still it wasn’t until 8 PM that I did what I wanted to do! Nevertheless, at least I have achieved my target before going home for the weekend.
After my successful integration of BlazeDS with our Spring application, this time I tried to go further. Wanted to fetch live data from database and show them in Flex data grid. First I created an action script object equivalent to my Java Object and tried to access its properties in data grid. I learnt that data grid accesses properties directly, not using getter methods, so had to change my class properties to public. I have to study action script further to find out if its really the convention.
Anyway, then I remembered, since I am using action script object from my mxml file, I will have to tell the compiler about the class when I compile it using Ant. After a lot of hassle, turns out ant tasks that adobe provides are for Flex 2 and the command parameters mentioned in the document for mxmlc doesn’t work with ant tasks! To be sure, I ran the mxmlc command manually and it worked. So now I replace the ant task for compiling with this -
<target name=”compileflex”>
<exec command=”${FLEX_HOME}/bin/mxmlc
${web.dir}/mxml/main.mxml
-source-path ${web.dir}/flexsrc
-services ${web.dir}/WEB-INF/flex/services-config.xml
-context-root /ma
-output ${build.dir}/main.swf”>
</exec>
</target>
This ant target executes the mxmlc command directly with the necessary parameters. Before reaching at this point though, I had to fight through Spring+Hibernate issues in my Dao class. The new Dao class I created couldn’t get hibernate session and had to replaced it with Spring’s jdbc template. Most probably the hibernate issue was related to OpenSessionInViewInterceptor, I will investigate it later. For now, I am really relieved and happy to see my data grid getting filled with data from server.
I am impressed how dedicated you are with Flex. I found my own way of working with Flex too.. ( more on the user side..
)
I have been scrapblogging. Its fun!
i am stuggling to get flex and blazeds work using ant build on linux.
do i need flex sdk installed on linux to get this work?? or flexTasks.jar shd be good enough. thanks.
Hi there, thanks for stopping by. You need flex sdk installed. It should be flex 3 (or above, if any). See the ant script, the variable FLEX_HOME actually points to the flex sdk.
Hope it helps.