Adobe Dreamweaver Forums



Last 10 THreads :         Repeater and XML problem (Last Post : ntsiii - Replies : 2 - Views : 4 )           »          Focus, Browsers & Spry Accordion (Last Post : CORDFrank - Replies : 5 - Views : 7 )           »          Can't upload selected pdf's to remote server (Last Post : sw2gtg - Replies : 1 - Views : 2 )           »          Disabling menu bars in a browser window (Last Post : Alan - Replies : 3 - Views : 4 )           »          Navigation from Contact Form (Last Post : sw2gtg - Replies : 3 - Views : 6 )           »          CF8 Help in Dreamweaver CS3 (Last Post : A.J.cfm - Replies : 0 - Views : 1 )           »          SWF slide show does not play (Last Post : sw2gtg - Replies : 1 - Views : 2 )           »          Javahelp/Oracle Help (Last Post : cindys@ddms.com - Replies : 9 - Views : 10 )           »          FlashVars help (Last Post : Cgull - Replies : 2 - Views : 3 )           »          Quiz results and slide views (Last Post : dlspielman@gmail.com - Replies : 0 - Views : 1 )           »         


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 10-30-2008, 02:45 AM
MacGyverMan
 
Posts: n/a
Diggs:
Default Working with Flat data from DB

I have data coming into flex via a remote AMFPHP object. The data is basically
an array containing generic objects
[0]
date, entry, grade, class, type, db_ID, language etc...
[1]
date, entry, grade, class, type, db_ID, language etc...
...

I want the user to be able to edit individual entries, mark them for update,
delete or insert and then synch with the DB.

The problem:
The user must be able to class the data according to:
=DATE 1
.....=GRADE 1
.........=CLASS 1
.............=TYPE 1
.................ENTRY 1
.................ENTRY 2
.............=TYPE 2
.................ENTRY 1
.................ENTRY 2
.........=CLASS 2
.............=TYPE 1
.................ENTRY 1
.................ENTRY 2
.............=TYPE 2
.................ENTRY 1
.................ENTRY 2

And so on.

Obviously the control the lends itself to this is the AdvancedDataGrid??
However, editing seems tricky since there doesn't seem to be an easy way to ADD
/ Delete entries from the dataprovider. (Keep in mind the source array is first
filtered for the correct dates, then grouped to form the hierarchy).

Right now: ADDING to the DP works, however the entry can't be selected once
it's inserted.
Right now: DELETING to the DP might work, but I can't find a way to insert a
delete button beside each entry.


So, finally, my question is:
Is there a better control that lends itself to this problem? I've thought of
using various comboboxes to allow the user to pick the day, class, subject,
type and then run the filterfunction. However, I can't find a way to traverse
my source data to get a list of the possible values to put into the combo boxes.

Thanks for anyhelp.



Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 10-30-2008, 02:53 PM
Greg Lafrance
 
Posts: n/a
Diggs:
Default Re: Working with Flat data from DB

May be best to return the data as XML, then you can easily put it in ComboBoxes or ADG. The data format always makes life easy or hard.
Reply With Quote
  #3 (permalink)  
Old 10-30-2008, 04:04 PM
*gsb*
 
Posts: n/a
Diggs:
Default Re: Working with Flat data from DB

Try here:
http://weblogs.macromedia.com/paulw/...tion_pa_3.html

His example here:

http://weblogs.macromedia.com/paulw/...presentationmo
del/demo/PresentationModel.html

I have use comboboxes before but this should be a good starting place.



Reply With Quote


  #4 (permalink)  
Old 10-30-2008, 05:23 PM
Amy Blankenship
 
Posts: n/a
Diggs:
Default Re: Working with Flat data from DB


"MacGyverMan" <webforumsuser@macromedia.com> wrote in message
news:geb33g$14j$1@forums.macromedia.com...
>I have data coming into flex via a remote AMFPHP object. The data is
>basically
> an array containing generic objects
> [0]
> date, entry, grade, class, type, db_ID, language etc...
> [1]
> date, entry, grade, class, type, db_ID, language etc...
> ...
>
> I want the user to be able to edit individual entries, mark them for
> update,
> delete or insert and then synch with the DB.
>
> The problem:
> The user must be able to class the data according to:
> =DATE 1
> .....=GRADE 1
> .........=CLASS 1
> .............=TYPE 1
> .................ENTRY 1
> .................ENTRY 2
> .............=TYPE 2
> .................ENTRY 1
> .................ENTRY 2
> .........=CLASS 2
> .............=TYPE 1
> .................ENTRY 1
> .................ENTRY 2
> .............=TYPE 2
> .................ENTRY 1
> .................ENTRY 2
>
> And so on.
>
> Obviously the control the lends itself to this is the AdvancedDataGrid??
> However, editing seems tricky since there doesn't seem to be an easy way
> to ADD
> / Delete entries from the dataprovider. (Keep in mind the source array is
> first
> filtered for the correct dates, then grouped to form the hierarchy).
>
> Right now: ADDING to the DP works, however the entry can't be selected
> once
> it's inserted.


Have you issued an itemUpdated() on the collection where the item is?

> Right now: DELETING to the DP might work, but I can't find a way to insert
> a
> delete button beside each entry.


Just add a property to each object "toDelete" or something, and make an
additional column to hold it. Or you could do something like this:
http://blog.flexmonkeypatches.com/20...togglebuttons/

> So, finally, my question is:
> Is there a better control that lends itself to this problem? I've thought
> of
> using various comboboxes to allow the user to pick the day, class,
> subject,
> type and then run the filterfunction. However, I can't find a way to
> traverse
> my source data to get a list of the possible values to put into the combo
> boxes.


Recursion is a PIA. You might want to look at this component for an idea of
an approach
http://www.quietlyscheming.com/blog/...alk-component/


Reply With Quote
  #5 (permalink)  
Old 10-31-2008, 02:33 AM
MacGyverMan
 
Posts: n/a
Diggs:
Default Re: Working with Flat data from DB

Thanks for the help guys.

So am I really better to use XML? I assumed a binary format would be much more
efficient...however I can't stand/understand how flex handles bindings and
multidimentional arrays. I wish it were as simple as PHP multimentional
hash-arrays.

Thanks for the suggestion to use itemUpdated, however it doesn't seem to
change anything. I don't think it's an issue of the arraycollection not knowing
of the changes since the changes should not affect the item's display...I
suspect it has something to do with the ADG's itemRenderers not beeing
generated properly due to the addition of an extra item.

Reply With Quote
  #6 (permalink)  
Old 10-31-2008, 03:33 PM
Amy Blankenship
 
Posts: n/a
Diggs:
Default Re: Working with Flat data from DB


"MacGyverMan" <webforumsuser@macromedia.com> wrote in message
news:gedmtj$pcg$1@forums.macromedia.com...
> Thanks for the help guys.
>
> So am I really better to use XML? I assumed a binary format would be much
> more
> efficient...however I can't stand/understand how flex handles bindings and
> multidimentional arrays. I wish it were as simple as PHP multimentional
> hash-arrays.
>
> Thanks for the suggestion to use itemUpdated, however it doesn't seem to
> change anything. I don't think it's an issue of the arraycollection not
> knowing
> of the changes since the changes should not affect the item's display...I
> suspect it has something to do with the ADG's itemRenderers not beeing
> generated properly due to the addition of an extra item.


Is it possible that's a problem in your itemRenderer code?


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 05:57 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
Cheap Car Insurance - Compare Motor Insurance
Endsleigh Car Insurance Natwest Car Insurance
More Than Car Insurance Norwich Union Car Insurance
Prudential Car Insurance Zurich Car Insurance
Inactive Reminders By Mished.co.uk