Adobe Dreamweaver Forums



Last 10 THreads :         Creating a boundry in the stage... (Last Post : Rob Dillon - Replies : 1 - Views : 2 )           »          Re: Mouse capture won't activate (Last Post : robertnagle - Replies : 0 - Views : 1 )           »          help! my FB3 has gone insane! (Last Post : peteandrus - Replies : 0 - Views : 1 )           »          help! my FB3 has gone insane! (Last Post : peteandrus - Replies : 0 - Views : 1 )           »          How come the html is being displayed, and not the link (Last Post : Skaterstu - Replies : 0 - Views : 1 )           »          Another way to accomplish this (Last Post : Andy-K - Replies : 2 - Views : 3 )           »          HELP! Cannot upload files in DW CS4 (Last Post : dan@hoppernet.org - Replies : 6 - Views : 7 )           »          Adobe Flash 10 kills Wimpy (Last Post : m77ty8uu - Replies : 32 - Views : 208 )           »          How do I unlock all files in site at once (Last Post : Alan - Replies : 1 - Views : 2 )           »          Load library clip into target on stage (Last Post : NedWebs - Replies : 5 - Views : 8 )           »         


Home Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
User Info Statistics
Go Back   Adobe Dreamweaver Forums > Other Macromedia/Adobe Products > Flex
 
Tags: , , ,



Reply
  #1 (permalink)  
Old 08-27-2008, 01:03 AM
vikceo
 
Posts: n/a
Diggs:
Default custom component design question

I have a xml file having children upto two levels. I want read this xml file
and create each parent node as a form with all the underlying children as form
items (say labels)...

what is suggested way to achieve that?

struct of xml is like
<tasks>
<task>
<attr1>val1</attr1>
<attr2>val2</attr2>
...
<actions>
<action1>act1</action1>
<action2>act2</action2>
</actions>
</task>
<task>
....
</task>
</tasks>




Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 08-27-2008, 02:59 AM
Amy Blankenship
 
Posts: n/a
Diggs:
Default Re: custom component design question


"vikceo" <webforumsuser@macromedia.com> wrote in message
news:g925co$cnh$1@forums.macromedia.com...
>I have a xml file having children upto two levels. I want read this xml
>file
> and create each parent node as a form with all the underlying children as
> form
> items (say labels)...
>
> what is suggested way to achieve that?
>
> struct of xml is like
> <tasks>
> <task>
> <attr1>val1</attr1>
> <attr2>val2</attr2>
> ...
> <actions>
> <action1>act1</action1>
> <action2>act2</action2>
> </actions>
> </task>
> <task>
> ....
> </task>
> </tasks>


Probably the easiest way is nested repeaters.

HTH;

Amy


Reply With Quote
  #3 (permalink)  
Old 08-28-2008, 01:06 AM
vikceo
 
Posts: n/a
Diggs:
Default Re: custom component design question

could you please elaborate a bit on this.. keeping the given xml in this post as example?
Reply With Quote


  #4 (permalink)  
Old 08-28-2008, 04:08 AM
Amy Blankenship
 
Posts: n/a
Diggs:
Default Re: custom component design question


"vikceo" <webforumsuser@macromedia.com> wrote in message
news:g94pd7$3vc$1@forums.macromedia.com...
> could you please elaborate a bit on this.. keeping the given xml in this
> post as example?


What is the final look you are going for?


Reply With Quote
  #5 (permalink)  
Old 08-28-2008, 04:40 AM
vikceo
 
Posts: n/a
Diggs:
Default Re: custom component design question

good question...

Well after reading this data into a 2 D metrix (or whatever flex names this)..
i have to pass every row of this metirx into a custom component.

And the component will generate a form having all the individual column of the
row as a formItem.

So, it is basically a dynamic UI based on that xml file.

Please suggest if this is the right approach and if yes then how to achieve it.

My progress on it is: i can read the xml properly. and also based on a passed
row to my component i can generate a form as desired.

But, I am not able to create a structure in which i can put the values after
reading from the xml and to pass it row wise to my component.

Reply With Quote
  #6 (permalink)  
Old 08-28-2008, 02:11 PM
Amy Blankenship
 
Posts: n/a
Diggs:
Default Re: custom component design question


"vikceo" <webforumsuser@macromedia.com> wrote in message
news:g955os$hhv$1@forums.macromedia.com...
> good question...
>
> Well after reading this data into a 2 D metrix (or whatever flex names
> this)..
> i have to pass every row of this metirx into a custom component.
>
> And the component will generate a form having all the individual column of
> the
> row as a formItem.
>
> So, it is basically a dynamic UI based on that xml file.
>
> Please suggest if this is the right approach and if yes then how to
> achieve it.
>
> My progress on it is: i can read the xml properly. and also based on a
> passed
> row to my component i can generate a form as desired.
>
> But, I am not able to create a structure in which i can put the values
> after
> reading from the xml and to pass it row wise to my component.


So, if I'm getting you correctly, what you want is one form for each record,
and one form control for each "field"?

You could do something like this:

<mx:ViewStack id="allForms">
<mx:Repeater id="formRepeater" dataProvider="{yourXML.children()}">
<mx:Form id ="formsArray"
label="{formRepeater.currentItem.name()}">
<mx:Repeater id="formItemRepeater"
dataProvider="{formRepeater.currentItem.children() >
<mx:FormItem id="formItemArray"
label="{formItemRepeater.currentItem.name()}">
<mx:TextInput
text="{formItemRepeater.currentItem.text()}"/>
</mx:FormItem>
</mx:Repeater>
</mx:Form>
</mx:Repeater>
</mx:ViewStack>

Note that this is not going to get you 100% of the way to your goal...it's
not going to properly display the full depth of the actions item, and I
didn't do anything to ake your XMLLists into XMLListCollections, so it's
going to give you errors about not being able to detect changes in
assignment yadda yadda. But it should make it so that you can read the docs
yourself and figure the rest out.

HTH;

Amy


Reply With Quote


  #7 (permalink)  
Old 08-28-2008, 06:13 PM
vikceo
 
Posts: n/a
Diggs:
Default Re: custom component design question

yes i want to create one form per line or record and this is good sample for
doing what I need.

But Amy, can i make it a bit generic? I mean say i have to pass individual row
to a custom component which will render this form at place i want in my mxml?

Reply With Quote
  #8 (permalink)  
Old 08-28-2008, 06:41 PM
Amy Blankenship
 
Posts: n/a
Diggs:
Default Re: custom component design question


"vikceo" <webforumsuser@macromedia.com> wrote in message
news:g96m2j$9bn$1@forums.macromedia.com...
> yes i want to create one form per line or record and this is good sample
> for
> doing what I need.
>
> But Amy, can i make it a bit generic? I mean say i have to pass individual
> row
> to a custom component which will render this form at place i want in my
> mxml?


There are plenty of generic examples in the help. I made you a specific
one, because that is what you asked for. No offense, but I think I'll spend
my time helping people who are more successful at taking my suggestions and
extrapolating them to move forward.


Reply With Quote
  #9 (permalink)  
Old 08-28-2008, 07:41 PM
vikceo
 
Posts: n/a
Diggs:
Default Re: custom component design question

I do agree.. Amy.. I am working on this my stuff for last 2 months and doing
every possible thing..

I asked you that question coz i have tried creating a mxml compoent which can
render me the stuff i asked you above.. But the problem is I am not able to
pass a collection in my mxml based custom component.

I am getting null every time..

After a lot of tries I also could not solve the problem of creating a two
dimensional matrix in which i can populate my xml as per node as row and all
attributes as children. However, I can read the xml data from the source...

So, I am trying to solve a big problem and to save time of people here asking
in parts and give that part a try first..

Reply With Quote


Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



© Camley Interactive (camley.info) 2008 - all logos and images are copywrite their respective owners.
Proud member of the Camley Interactive Network
All times are GMT. The time now is 02:17 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
Inactive Reminders By Mished.co.uk