Hi Richard,

I recently completed a project in which we had to dynamically build
form selection elements based on different control types (eg.
checkboxes, radio buttons, etc...).  The data model we worked with
provided us with the string name of the control type to use, and the
appropriate data structure to populate the control type(s).  Solution
I came up with was to (as you mention you might have to do) create the
form elements using actionscript, more specifically the createChild
method.  I created a custom instance of each control type, and added
some additional properties to it, the most important being the data
property it needed to affect.  Inside the custom control, I had my
change event directly modify the data property that was passed in. 
Because the reference was passed in, this essentially "bound" that
change to the data model it came from.  Problem solved.

Your requirements may be slightly different as it sounds like you
already know what type of control you need to render.  In this case, I
would imagine you could use a repeater tag and have it's children be
the custom "check box" you're creating, and pass in the object
property reference that needs to be changed.

Hope this helps you...


Brendan


--- In [email protected], Richard Rodseth <[EMAIL PROTECTED]> wrote:
>
> Yes, as I mentioned, I am using the repeater tag. But the data
provider for
> it is the list of all possible roles. I'm interested in the process of
> mapping the checked items to an array of objects (strings or value
objects).
> I'm guessing there's no way around using Actionscipt to populate the
form
> from the model and vice versa.
> 
> - Richard
> 
> On 11/2/05, Matt Chotin <[EMAIL PROTECTED]> wrote:
> >
> >  Check out the Repeater tag.
> >
> >   ------------------------------
> >
> > *From:* [email protected]
[mailto:[EMAIL PROTECTED] *On
> > Behalf Of *Richard Rodseth
> > *Sent:* Wednesday, November 02, 2005 9:07 AM
> > *To:* [email protected]
> > *Subject:* [flexcoders] Flex 1.5 - n checkboxes
> >
> >  Is there a slick way to bind a variable number of checkboxes to
an array
> > of value objects in a data model?
> >
> > Example: user has an array of roles. Display a list of checkboxes
> > I see how to use repeaters to render the checkboxes, but I'm
unclear on
> > the best way to capture the user selections.
> >
> > Thanks
> >
> >
> >
> >  --
> > 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
> >
> >
> >    - Visit your group
"flexcoders<http://groups.yahoo.com/group/flexcoders>"
> >    on the web.
> >     - To unsubscribe from this group, send an email to:
> >   
[EMAIL PROTECTED]<[EMAIL PROTECTED]>
> >     - Your use of Yahoo! Groups is subject to the Yahoo! Terms of
> >    Service <http://docs.yahoo.com/info/terms/>.
> >
> >
> >  ------------------------------
> >
>







------------------------ Yahoo! Groups Sponsor --------------------~--> 
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/nhFolB/TM
--------------------------------------------------------------------~-> 

--
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

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to