Are you trying to access a class called search or a method called search on the class RemoteService?  Do you have the RemoteService class in your whitelist?  Are you passing in the expected arguments?  What is the exact error message you are seeing?  Can you put a println in your search method on the Java side and see if it comes out in your console?

 

I’m guessing you’re having a whitelist problem or passing unexpected arguments.

 

Matt

 


From: [email protected] [mailto:[email protected]]
Sent: Sunday, April 17, 2005 4:42 PM
To: [email protected]
Subject: [flexcoders] RemoteObject frustration

 


I have been looking at this forever and can't figure out what I am
missing.
I am trying to access a class called search.  I am passing in some
text and would like to receive data based on my text.  Right now the
classes are very basic for testing the RemoteObject.

I am receiving the error message that 'search' cannot be found.  It
seems to balk at the ro.search(searchCriteria) line listed below. I
can't even figure out if the problem lies in the java code or the
mxml code.  Here is a copy of my MXML file:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml"
initialize="initApp()">

      <mx:Script>
      <![CDATA[
            import com.greetingsxpress.cards.services.*;
           
            var searchCriteria:SearchCriteriaVO;
            var searchResult:SearchResultVO;
           
            function initApp() {
                  searchCriteria = new SearchCriteriaVO();
                  searchResult = new SearchResultVO();
                  searchResult.cards = new Array();
            }
           
            function doSearch() {
                  searchCriteria.text = "foo";
                  ro.search(searchCriteria);
            }
                       
            function customizeCard( idx ) {                 
                  cardSelected.text = searchResult.cards[idx];
            }
                 
        function resultHandler() {
            //cardsArray=ro.search.result.cards;
                  searchResult = ro.search.result;
                 
        }
          ]]>
      </mx:Script>
     
      <mx:RemoteObject id="ro"
source="com.greetingsxpress.cards.services.RemoteService">
        <mx:method name="search" result="resultHandler()"/>
    </mx:RemoteObject>
     
      <!--<mx:Model id="cardModel">
            <name>{searchResult.imageReference}</name>
      </mx:Model>
     
      <mx:Array id="cardsArray"></mx:Array>-->
      <mx:Canvas width="400" height="400">
           
            <mx:Button label="Get Cards" click="doSearch()"/>
            <mx:Tile>
                  <mx:Repeater id="cards" count="2"
dataProvider="{searchResult.cards}">
                  <mx:Text id="cardSelected" text="Text" />
                              </mx:Repeater>
            </mx:Tile>       </mx:Canvas>
</mx:Application>



ANY help would be appreciated!!
Thank you






Yahoo! Groups Links

Reply via email to