Adobe Dreamweaver Forums



Last 10 THreads :         Table Borders MIssing in JavaHelp (Last Post : soxmann - Replies : 3 - Views : 8 )           »          Clock .getUTC not working (Last Post : bolszo - Replies : 2 - Views : 3 )           »          cfimage error (Last Post : masoud_amen - Replies : 2 - Views : 3 )           »          Dragging components (Last Post : hsfrey - Replies : 2 - Views : 4 )           »          Is file too large? (Last Post : tweaked_eye - Replies : 0 - Views : 1 )           »          Could not find the included template (Last Post : azuro28 - Replies : 2 - Views : 3 )           »          problems linking PDFs (Last Post : Mantzi - Replies : 0 - Views : 1 )           »          flash loader reappears after movie plays (Last Post : lyshamo - Replies : 3 - Views : 4 )           »          How to turn IMAGE into MOVIECLIP??? (Last Post : Snufferson - Replies : 7 - Views : 8 )           »          Embed files in a projector (Last Post : ytlevine - 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 11-24-2008, 05:13 PM
alice_data
 
Posts: n/a
Diggs:
Default Update Multiple Rows at Once in the Database

Hi,

My client wanted me to create something that allows certain DataGrid to
display to allow users to edit and update the database records. The only
dilemma I am having here is how to actually create something from Flex's end to
allow users update several rows of the database at once. Since everything in my
datagrid would be defined as selectedItem whenever a user accesses the entry,
how can I get Flex to recognize each of the updated variables while I update
the database?

Another question is, if I do something like dg2.selectedItem.id, it would only
display the "selectedItem," and since I intend to loop every single one of the
values as such in the datagrid to be updated, is it possible to do something
like dg..id? I tried to do this, and I kept on getting errors.

If anyone could refer me to some examples on how to get this to start, it
would be great.

Thanks in advance.

Alice

This is the current code I have:

Attach Code:

<mx:HTTPService id="save_scenario" method="POST"
url="http://localhost/save_scenario.php" useProxy="false">
<mx:request xmlns="">
<scenario_name>{scenario_name}</scenario_name>
<id_no>{dg2.selectedItem.id}</id_no>
<region_name>{dg2.selectedItem.region_name}</regio n_name>
<population>{dg2.selectedItem.population}</populat ion>
<market>{dg2.selectedItem.market}</market>
</mx:request>
</mx:HTTPService>



Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 11-25-2008, 12:32 AM
*gsb*
 
Posts: n/a
Diggs:
Default Re: How to Make SelectedItem be a Dynamic Variable?

Hummm....

I think you need to view the problem in steps.
First I think you need to update one record at a time.

So when a row is clicked on, it pops up an edit form.
When submitted (button perhaps) it updated the data provider of the data grid:
instant show of the change.
At the same time, an HTTP service call is made to update the data base. There
is no need to update the application with the new data from the server.

Now back on the data grid the user can pick another record to update.

Buttons could be added for Add, Delete and use click for Edit perhaps.



Reply With Quote
  #3 (permalink)  
Old 11-25-2008, 12:43 AM
Amy Blankenship
 
Posts: n/a
Diggs:
Default Re: Update Multiple Rows at Once in the Database


"alice_data" <webforumsuser@macromedia.com> wrote in message
news:ggen1o$a3c$1@forums.macromedia.com...
> Hi,
>
> My client wanted me to create something that allows certain DataGrid to
> display to allow users to edit and update the database records. The only
> dilemma I am having here is how to actually create something from Flex's
> end to
> allow users update several rows of the database at once. Since everything
> in my
> datagrid would be defined as selectedItem whenever a user accesses the
> entry,
> how can I get Flex to recognize each of the updated variables while I
> update
> the database?


Add like an updated property to each item in the collection. Then set it
when the user has changed something. Then filter the collection to items
that have been updated and send them to the server.


Reply With Quote


  #4 (permalink)  
Old 11-25-2008, 02:52 AM
alice_data
 
Posts: n/a
Diggs:
Default Re: How to Make SelectedItem be a Dynamic Variable?

Hi,

My dataGrid is editable in the first place, since there are not that many
things in need of a new form. So, I think one of things I have to find out is
how to pass the variables on to the HTTPService,

When I declare the variable, dg.[i].id, is this how I should declare my
variables that loop around for the PHP to process?

Thanks in advance.

Alice

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 11:39 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