One more thing i tried and observed that there might be problem with LCDS that I have integrated in my jboss as
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" initialize="Handler()"> <mx:Script> <![CDATA[ import mx.controls.Alert; import mx.rpc.soap.WebService; import mx.binding.utils.BindingUtils; import mx.collections.ArrayCollection; [Bindable] private var _stateService:WebService; private function Handler():void{ Alert.show("hi"); _stateService = new WebService(); _stateService.wsdl="http://localhost:8080/tdemandweb/services/ ProductThresholdService?wsdl" _stateService.loadWSDL(); _stateService.getData.send(); } ]]> </mx:Script> <mx:DataGrid id="Urdg" dataProvider="{ _stateService.getData.lastResult.results}" width="100%" height="100%"> <mx:columns> <mx:DataGridColumn dataField="name" headerText="Name"/> <mx:DataGridColumn dataField="price" headerText="Price"/> <mx:DataGridColumn dataField="productId" headerText="Product Id"/ > <mx:DataGridColumn dataField="description" headerText="Description"/> <mx:DataGridColumn dataField="category" headerText="Category"/> </mx:columns> </mx:DataGrid> </mx:Application> Above program is run successfully through flex builder which uses sdk3.1 version for compilation. If i copy the same program in my jboss , it does not returns me the values. Then I copied the .swf generated by flex builder in my jboss and it worked. This means that there is difference between the .swf created by flex buikder and lcds. The LCDS which I used my project is not compiling in the way flex builder compiles. Could you please guide me on this? Can I used sdk3.1 in jboss to compile .mxml file to .swf ? if yes, how? Thanks & Regards, Chandan On Sep 29, 11:18 am, chan <[EMAIL PROTECTED]> wrote: > Hi Imtiyaz, > > Thanks for replying, > > At the end of this post, I will write the flexproductdata.as and > flexproductdata.java classes. > Before that I have to clarify some points from you. > > 1) In order to run any flex program in existing webapplication, What > steps I need to followed? > - The steps that i followed are, > a) I have downloaded a sample program which was deployed on > jboss from net. > b) From that sample program, I copied flex folder to my > application under WEB-INF folder, Copy the lib files related to flex > in to lib directory of my application and done some changes related to > flex entries in existing web.xml. > 2) How to find out the version of LCDS(flex folder) which I copied to > my existing web application? > > -See I called getData method of the webservice and that method returns > me the list of FlexProductData object. > See the getData method of the webservice with its package structure. > > package com.tdemand.server.service.productthreshold; > public class ProductThresholdsSerivceImpl implements > ProductThresholdService{ > > public List getData() throws AuthorizationException, > StartIndexOutOfBoundsException { > logger.debug("***************started getData method of > productthresholdspojoserviceimpl"); > ArrayList list = new ArrayList(); > FlexProductData fproddata= new FlexProductData(); > fproddata.setProductId(10); > fproddata.setName("kitkat"); > fproddata.setPrice(10.25); > fproddata.setDescription("nice chocalate"); > fproddata.setCategory("category"); > list.add(fproddata); > return list; > } > > } > > See below code for FlexProductData.as > > package > { > import flash.net.registerClassAlias; > public class FlexProductData extends Object > { > var productId:int ; > var name:String; > var description:String; > var category:String; > var price:Number; > } > > } > > I have copied the FlexProductData.as in my jboss. I really do not know > where to copy the as file in jboss. I tried it by copying it in the > same directory where my mxml file was present but it did not work. > > One more thing Imitiyaz, > I could run the program which was mentioned in my previous post > through flex builder but if I copy the same program in jboss , it was > showing me the same error i.e. invalid type flexproduct etc. and that > is why i want to know from you, what are the steps that i need to > follow. How can I sure that in the jboss , I am using latest version > of LCDS? > > Could you please guide me on this? Thanks. > > Regards, > chandan > > On Sep 28, 10:21 pm, imtiyaz <[EMAIL PROTECTED]> wrote: > > > > > First of all sorry for the late reply, I was in journey from last two > > days, > > Ok lets come to the point, > > This is definetly not with LCDS version, > > > Second I want to know the code of your FlexProductData.as file from > > its package and I want to know about the your java class package > > structure. > > Did you copied the swf file into JBOSS or you copied the source... > > just want to know how you are deploying the application. > > > Did you copied... the FlexProductData.as file also into JBOSS !!!! > > > Regards, > > Imtiyaz Basha M S > > > On Sep 26, 1:08 pm,chan<[EMAIL PROTECTED]> wrote: > > > > Hi Imtiyaz, > > > > Thanks a lot, I could run the application through flexbuilder. > > > > Imtiyaz, I am using flexbuilder( Latest free trial version) as a tool > > > to develop the flex program and after program runs succesffully > > > through flex builder , I copy it to my jboss applciation and try to > > > run it. > > > > First think, the code you have given me in last post is changed to as > > > follows in order to run it through flexbuilder. > > > > <mx:Script> > > > <![CDATA[ > > > import mx.controls.Alert; > > > import mx.rpc.events.ResultEvent; > > > import mx.collections.ArrayCollection; > > > private function > > > displayPersonDetails(event:ResultEvent):void > > > { > > > var myAc :ArrayCollection = new ArrayCollection(); > > > var fpd:FlexProductData = null; > > > var list:ArrayCollection = new ArrayCollection(); > > > list=(ArrayCollection)(event.result); > > > var fdata:Object; > > > for(var i:int = 0;i< list.length;i++){ > > > fdata =Object(list.getItemAt(i)); > > > Alert.show(fdata.name); > > > myAc.addItem(fdata); > > > } > > > Urdg.dataProvider = myAc; > > > } > > > ]]> > > > </mx:Script> > > > > The purpose of type casting the list object to Object(flex object) > > > that It was showing me the same error if i type cast to > > > FlexProductData object of FlexProductData.as class. > > > > Initially above code will be fine for me now. We can solve that > > > problem later on , as I may have place .as file in wrong directory or > > > somethink is missing. > > > > Problem is that If I run the same program thorugh jboss application, > > > it is giving me the same error i.e. > > > RPC Fault faultString="Cannot find type for: FlexProductData" > > > faultCode="DecodingError" faultDetail="null"] > > > at mx.rpc.soap::Operation/http://www.adobe.com/2006/flex/mx/ > > > internal::processResult() > > > at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/ > > > internal::resultHandler() > > > at mx.rpc::Responder/result() > > > > I can run other flex program through jboss but am understanding why > > > the same program which runs in flexbuilder is not running in jboss. > > > > My prediction is that, running the flex program thorugh flex builder > > > might be using different version of LCDS and the one which is there in > > > jboss is different. I do not know how to find out the difference > > > between these 2 version. > > > > Could you please guide me where i am doing wrong think? and if > > > possible let me know also how to create the flexproduct data and where > > > to put it in jboss? > > > > Once again I would thank to you as we are very much closer to solve > > > the problem. > > > > Let me know if you need more details on this. > > > > Thanks, > > > chandan > > > > On Sep 25, 3:51 pm, imtiyaz <[EMAIL PROTECTED]> wrote:> First Note : Add > > > a handler to your webservice result event. in the > > > > handler w > > > > > Point 1 : your webservice is returning ArrayList which flex will die > > > > to understand :) , So the type cast it using ArrayCollection. > > > > Point 2 : your arraylist (result) contains collection FlexProductData, > > > > here again flex will die to understand. so Create a similar action > > > > script class in Flex, and use it. > > > > > pacakage your.package.name{ > > > > > public class FlexProductData { > > > > public var productID : int ; > > > > > fproddata.setProductId(10); > > > > fproddata.setName("kitkat"); > > > > fproddata.setPrice(10.25); > > > > fproddata.setDescription("nice chocalate"); > > > > fproddata.setCategory("category"); > > > > > } > > > > > On Sep 25, 12:04 pm,chan<[EMAIL PROTECTED]> wrote: > > > > > > Hi Imtiyaz.m.s ,Anubhav > > > > > > Thanks for your response, > > > > > > I am understanding what you are saying. But as I am new to this > > > > > technology, I am not understanding of what type of class I should > > > > > write so that it can be type casted with FlexProductData. Is it > > > > > actionscript class that you were talking about? > > > > > > I will let you know what exactly my webservice returns, > > > > > > See after calling the getData method of the webservice mentioned > > > > > above, it goes to getData method of the webservice. Please see the > > > > > getData method below. > > > > > > public List getData() throws AuthorizationException, > > > > > StartIndexOutOfBoundsException { > > > > > ArrayList list = new ArrayList(); > > > > > FlexProductData fproddata= new FlexProductData(); > > > > > fproddata.setProductId(10); > > > > > fproddata.setName("kitkat"); > > > > > fproddata.setPrice(10.25); > > > > > fproddata.setDescription("nice chocalate"); > > > > > fproddata.setCategory("category"); > > > > > list.add(fproddata); > > > > > return list; > > > > > } > > > > > > This result I want to show on ui using above flex program i.e. > > > > > <?xml version="1.0" encoding="utf-8"?> > > > > > <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" > > > > > backgroundColor="#FFFFFF"> > > > > > <mx:WebService id="srv" wsdl="http://localhost:8080/ > > > > > tdemandweb/ > > > > > services/ProductThresholdService?wsdl" showBusyCursor="true" /> > > > > > <mx:DataGrid dataProvider="{srv.getData.lastResult}" > > > > > width="100%" > > > > > height="100%"> > > > > > <mx:columns> > > > > > <mx:DataGridColumn dataField="name" > > > > > headerText="Name"/> > > > > > <mx:DataGridColumn dataField="price" > > > > > headerText="Price"/> > > > > > <mx:DataGridColumn dataField="productId" > > > > > headerText="productId"/> > > > > > <mx:DataGridColumn dataField="description" > > > > > headerText="description"/> > > > > > > > ... > > read more »- Hide quoted text - > > - Show quoted text - --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Flex India Community" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/flex_india?hl=en -~----------~----~----~----~------~----~------~--~---

