tags:

views:

25

answers:

1

am sending one user object from java to flex using remote object,now i want to get each item from that array to display in text boxes...how can i do this ?

userInfo=event.result as Array;

    <mx:FormItem label="FirstName" fontWeight="bold" width="325" required="true">
     <mx:TextInput id="firstname" text="{userInfo.getItemAt(0)}" width="220"/>
    </mx:FormItem>

    <mx:FormItem label="LastName" fontWeight="bold" width="325" >
     <mx:TextInput id="lastname" text="{userInfo.getItemAt(1)}" width="220"/>
    </mx:FormItem>

    <mx:FormItem label="Address" fontWeight="bold" width="325" >
     <mx:TextArea  id="address" text="{userInfo.getItemAt(2)}"  >
    </mx:FormItem>

...i want something like this...Please help me any one

A: 

Try (userInfo[0] as String).

  • Check if userInfo isn't null.

(with Charles you could check if the userInfo is sent correctly with http).

Lieven Cardoen
@Lieven Cardoen : no am getting correct array through remote object,but here now can i distribute array items to form items ?
Thirst for Excellence
I suppose you TextInput is in the same class as userInfo. Have you tried your example? Does flex give an error or do you see empty textinputs? Try to set a breakpoint at the TextInputs and check in the Variables window what's inside userInfo. Also try [0] instead of getItemAt(0). Your example seems correct.
Lieven Cardoen