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

  • SEARCH
  • Home
  • 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 6184921
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T01:37:21+00:00 2026-05-24T01:37:21+00:00

I have two tables: Person {pID, pName, deptID} and Departments {deptID,deptName} An SQL statement

  • 0

I have two tables: Person {pID, pName, deptID} and Departments {deptID,deptName}
An SQL statement like this gets me the name of a person and the department name:

SELECT pName, departments.deptName FROM people INNER JOIN people.deptID = departments.deptID;

The above works fine. I have a Flex DropDownList that is populated with deptNames. When I click the submit button, I am able to obtain the ID of the selected department without problem:

protected function button_clickHandler(event:MouseEvent):void
   {
    person.pName=pNameTextInput.text;
    person.deptID=pDepartmentDropDownList.selectedItem.deptID; //ID of selected department obtained correctly.
    if (person.pID == 0)
    {
     createPersonResult.token=personService.createPerson(person);
    }
    else
    {
     updatePersonResult.token=personService.updatePerson(person);
    }
  }

I have a createPersonresult Handler that attempts to update the datagrid when a person is added. The datagrid is updated with the new added person, but in the department column, I get the ID of the department chosen from the dropdownlist. I need to reload the flash app to get the datagrid refreshed to display the deptName.

Something is missing in this createPerson result Handler. Google didn’t provide much help.

   protected function createPersonResult_resultHandler(event:ResultEvent):void
   {
    currentState="PeopleDetails";
    person.pID=event.result as int;
    peopleDg.dataProvider.addItem(person); //the problem might be here, more below.
    peopleDg.setSelectedIndex(peopleDg.dataProvider.getItemIndex(person));
    peopleDg.ensureCellIsVisible(peopleDg.selectedIndex);
   }

From the comment above, I see that adding person will indeed add the attributes of the person object to the datagrid, except that one attribute is a foreign ID (deptID) from departments.

  • 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-24T01:37:21+00:00Added an answer on May 24, 2026 at 1:37 am

    I think you need to set your deptName property since you aren’t getting it from the join when it’s being added in the interface. So something like this should do the trick I think?

    EDIT: for 4.5 dropdown instead of combobox

    protected function button_clickHandler(event:MouseEvent):void
    {
        person.pName=pNameTextInput.text;
        person.deptID=pDepartmentDropDownList.selectedItem.deptID; //ID of selected department obtained correctly.
        person.deptName = pDepartmentDropDownList.selectedItem.deptName;
        if (person.pID == 0)
        {
            createPersonResult.token=personService.createPerson(person);
        }
        else
        {
            updatePersonResult.token=personService.updatePerson(person);
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two tables kinda like this: // Person.Details Table: PersonID int [PK] |
I have two tables built like this (this is just a simplified and non-proprietary
In sql server, I have two tables (lets say Person and School). I want
We have two Tables: Document: id, title, document_type_id, showon_id DocumentType: id, name Relationship: DocumentType
I have following two tables: Person {PersonId, FirstName, LastName,Age .... } Photo {PhotoId,PersonId, Size,
I have two tables which look like the following tools : id | part
I have two simple mappings: <class name="org.testing.Person" table="PERSON"> <id name="personId" type="long" column="PERSON_ID"> <generator class="native"/>
I have two tables in my database. A person and a coach table. The
Say, I have two tables Person and Car and I link these two. The
I have these two tables in MySql: [Person] PersonId NameFirst NameLast [Email] EmailId PersonId

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.