reusing RemoteObject methods

Ask a Question related to Macromedia Flex General Discussion, Design and Development.

  1. #1

    Default reusing RemoteObject methods

    Hi,
    I'm using a RemoteObject (userService.CFC) to return data to combo-boxes.

    I would like to populate several arrays using the same method with different
    parameters
    i.e.

    userService.getUsersByDept('Marketing') or
    userService.getUsersByDept('Finance')

    My question is, what is the best method to handle the return set?

    I don't think that something like

    myArray = userService.getUsersByDept('Marketing') as Array;

    will work correctly, but I can't figure out how to handle populating
    different arrays with something like

    <mx:method name="getUsersByDept" result="handleReturnedUserResult(event)"
    ..../>

    and keep the function and eventhandler generic. I don't want to have to
    hard-code the event handler with specific cases.

    Thanks, and any suggestions will be greatly appreciated.
    bri


    <mx:method name="getUsersByDept" result="handleReturnedUserResult(event)" .../>

    bfifield Guest

  2. Similar Questions and Discussions

    1. Reusing a Result Set
      Hi, Lets say I have the following: <cfquery datasource="#data#" name="getData"> Select * from emp </query> Within the page I can use this...
    2. Reusing Columns in the same row
      Hello, I need to do something like mentioned below: I have a table of 5 rows and 10 columns. I need to print the results (coming from db) in...
    3. Reusing Parameters across web methods
      I have a WSDL interface written by our customer. I want to create our own web service instance that we can test our software against. So I used...
    4. #26350 [NEW]: Inherited methods can't access private methods
      From: forseti at oak dot rpg dot pl Operating system: Windows 98 SE PHP version: 5.0.0b2 (beta2) PHP Bug Type: Zend Engine 2...
    5. Aliased setter methods behave differently than other methods?
      Here's another question... I am aliasing and redefining certain methods, determined at runtime. Normal methods work fine, but methods ending in '='...
  3. #2

    Default Re: reusing RemoteObject methods

    userService.cfc should return a struct with two properties. The first should
    be the destination of the data (which combo box). The second should be the
    query recordset.

    Then when you receive the resultEvent to handleReturnedUserResult, you'll need
    to check the message body's destination property to determine what combobox in
    flex should have its dataProvider set. You can do this using if else
    statements or some sort of dynamic evaluation.

    Bryan Dresselhaus Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139