Adobe Dreamweaver Forums



Last 10 THreads :         Re: Accurate measurements for printing (Last Post : Don_Gough@adobeforums.com - Replies : 0 - Views : 1 )           »          Re: Paint, erase, burn and dodge won't work for me in CS4 (Last Post : John Joslin - Replies : 0 - Views : 1 )           »          Re: Accurate measurements for printing (Last Post : Don_Gough@adobeforums.com - Replies : 0 - Views : 1 )           »          button rollover to keyframe help (Last Post : mrpetesurfs - Replies : 1 - Views : 2 )           »          Call out side flex (Last Post : G009 - Replies : 13 - Views : 14 )           »          Scaling .swf files to fit specific dimensions (Last Post : wolfsj - Replies : 0 - Views : 1 )           »          Array of Queries (Last Post : ptrott - Replies : 0 - Views : 1 )           »          Can't get Macromedia Authorware Web Player to install onWindows Vista (Last Post : auberj - Replies : 0 - Views : 1 )           »          Form split across two columns (Last Post : RICH POW - Replies : 6 - Views : 7 )           »          NetLobo and Hidden
Tags (Last Post : kiusau - 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 > Macromedia Software > Flex
 
Tags:



Reply
  #1 (permalink)  
Old 11-03-2008, 04:39 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 11-03-2008, 04:39 AM
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 11-03-2008, 04:39 AM
*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 11-03-2008, 04:39 AM
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 11-03-2008, 04:39 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 11-03-2008, 04:39 AM
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


  #7 (permalink)  
Old 11-03-2008, 04:39 AM
MacGyverMan
 
Posts: n/a
Diggs:
Default Re: Working with Flat data from DB

I thought so, but I got rid of the custom renderer.

Dammit...I wish I could post the SWF to show what happens...however it's running of amfphp on a local server
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 09:40 PM.


Right Column Title


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