Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4096314
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T20:01:50+00:00 2026-05-20T20:01:50+00:00

SOLVED I have a Flex/PHP app I’m working on. I have a single ArrayCollection

  • 0

SOLVED

I have a Flex/PHP app I’m working on.

I have a single ArrayCollection for a data source, but have 8 datagrids (named dg1 through dg8). I use 8 datagrids for logical presentation (4 years of college, 2 semesters per year). I have a column with “X” (for “delete this record”) that goes to a function when clicked.

What I’d like to do is pass the datagrid id (such as “dg1”) and the data provider {syllabus.freshFall} to a function. I’ve been trying my hardest to find how I do this, but have only found examples of single datagrids (which look pretty easy) and referring to a single fixed datagrid like this:

course_id=dg1.selectedItem.course_ID;
syllabus.freshFall.removeItemAt(dg1.selectedIndex);

I want to make this something like this:

course_id=**whateverDataGrid**.selectedItem.course_ID;
**whateverDataProvider**.removeItemAt(**whateverDataGrid**.selectedIndex);

NOW I need help passing my c_id variable to my HTTPService.

Thanks for ALL your help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T20:01:51+00:00Added an answer on May 20, 2026 at 8:01 pm

    PARTIAL ANSWER:

    with help from Adobe LiveDocs for Flex 3

    <mx:LinkButton label="X" click="outerDocument.itemClickEvent('1',event)"/>
    
    
    public function itemClickEvent(id:String, event:MouseEvent):void {
            var mydp:Object;
            switch(int(id))
            {
                case 1:
                    mydp=syllubus.freshFall;
                    break;
                                   .
                                   .
                                case 8:
                    mydp=syllubus.seniorSpring;
    
                default:
                    trace("Out of range");
                    break;
            }
            id = "dg" + id;
            c_id=this[id].selectedItem.course_ID;
            mydp.removeItemAt(this[id].selectedIndex);  //superficial datagrid delete
    

    I would still like to make the data provider more of a variable, just to be complete. I tried several different approaches and the case statements were the closest to what I wanted and it worked for now.

    Figured out passing my c_id variable from my function to my HTTPService. Not exactly as straight-forward as I would have hoped…

    Build a variable in the type of Object
    Add an element to the object of the name of your variable you want to pass
    Add a value for the variable.
    Pass the

    It looks like this:

    function blah (var:int, ...rest):void {
    
    code...
    
    code...
    
    c_id= *whatever*;
    params["cid"] = c_id;
    update.send(params);  (where "update" is the HttpService id)
    }
    
    .
    .
    .
    .
    
    <mx:HTTPService 
        id="update"     
        url="http://localhost/myFile.php" 
        method="POST"  
        etc...>
     <mx:request>
       <xmlstring>{XMLString}</xmlstring>   (this xml string is generated elsewhere)
       <cid>c_id</cid>
     </mx:request>
    </mx:HTTPService>
    

    Hope this helps someone else. It’s been a bit of a pain to piece this all together.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Problem solved, see below Question I'm working in Flex Builder 3 and I have
I'm trying to build a calculator in Flex / actionscript 3 but have some
XML is cool in flex, but I have an annoying problem to solve, caused
Edit: I have solved this by myself. See my answer below I have set
I have a problem that I would like have solved via a SQL query.
The responses I've got to this question have solved the problem I had in
This is something I've pseudo-solved many times and have never quite found a solution
Problem solved: Thanks guys, see my answer below. I have a website running in
I have an idea for how to solve this problem, but I wanted to
[Solved] Writing parsing code is a trap. A line with 15 spaces will have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.