This would just be an MXML component.  Somehting like this:

 

MyFormItem.mxml

<mx:FormItem xmlns:mx=http://www.macromedia.com/2003/mxml label=”{label}”>

  <mx:Script>

     Public var label:String;

  </mx:Script>

  <mx:TextInput id=”name” />

</mx:FormItem>

 

Then in your MXML:

 

<MyFormItem label=”name1” />

<MyFormItem label=”name2” />

 

HTH,

Matt


From: [email protected] [mailto:[email protected]] On Behalf Of Chris Ruegger
Sent: Tuesday, September 06, 2005 12:53 PM
To: [email protected]
Subject: RE: [flexcoders] passing array of Form values in VO

 


Matt,

could you give me more info on how exactly I'd do this? Ive not written any Flex custom components yet.

Thanks,

Chris


Matt Chotin <[EMAIL PROTECTED]> wrote:

Easiest way might be to componentize the FormItem.  Then you give the FormItem its own id but the IDs inside all can be the same.

 

Matt

 


From: [email protected] [mailto:[email protected]] On Behalf Of cruegger2000
Sent: Thursday, September 01, 2005 12:25 PM
To: [email protected]
Subject: [flexcoders] passing array of Form values in VO

 

I want to have a form on the client side that accepts
a list of items of the same type/meaning, for example people's names.
I would then send a value object to a server side Delegate object
using the <mx:RemoteObject> construct.

However, I don't know how to indicate that a form variable
is an "array" without getting duplicate component id errors.
In essence, I want to do what is shown below. How can I have a
"vector" form variable using Flex?
Thanks in advance.

mxml file:
<mx:Form>
<mx:FormItem label="name1">
  <mx:TextInput id="name"/>
</mx:FormItem>

<mx:FormItem label="name2">
  <mx:TextInput id="name"/>
<mx:FormItem>

<mx:FormItem label="name3">
  <mx:TextInput id="name"/>
</mx:Form>


Client side value object:
-------------------------
class Foo
{
  public var names: Array;
}


Server Side value object:
-------------------------
public class Foo
{
  private String[] names; (or List)
 
  // accesors
}







__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com


--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




YAHOO! GROUPS LINKS




Reply via email to