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 792901
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T22:04:00+00:00 2026-05-14T22:04:00+00:00

I am trying to build my first CRUD application and cant get the update

  • 0

I am trying to build my first CRUD application and cant get the update query to work. Here is the MXML and AS.

<?xml version="1.0" encoding="utf-8"?>

<fx:Script>
    <![CDATA[
        import mx.controls.Alert;
        import mx.events.DataGridEvent;
        import mx.events.FlexEvent;
        import mx.rpc.events.ResultEvent;

        protected function init(event:FlexEvent):void
        {
            // TODO Auto-generated method stub
            //login.addEventListener(MouseEvent.CLICK, clickMe);
        }

        protected function doLogin(event:MouseEvent):void
        {
            trace('doLogin');
            //Alert.show("doLogin");
            loginResult.token = customUserClass.login(username_txt.text, password_txt.text);

            //sayHelloResult.token = user.sayHello('Jeff');
            //sayHelloResult.addEventListener(ResultEvent.RESULT, fromCallingHello);
        }

        protected function loginResultEvent(event:ResultEvent):void {
            //Alert.show(event.result.toString(), 'loginResult');
            trace (event.result.toString());
            if (event.result == true) {
                currentState = 'LoggedIn';
            }
        }

        //protected function fromCallingHello(event:ResultEvent):void {
        //  Alert.show(event.result.toString(), 'fromCallingHello');
        //  trace (event.result.toString());
        //}


        protected function dataGrid_creationCompleteHandler(event:FlexEvent):void
        {
            getAllUsersResult.token = usersService.getAllUsers();
            //usersService.getAllUsers();
        }


        protected function dataGrid_itemEditEndHandler(event:DataGridEvent):void
        {
            // TODO Auto-generated method stub
            //var user:Users = new Users();
            //userServiceValueObject[event.dataField]=(dataGrid.itemEditorInstance as mx.controls.TextInput).text;
            //usersService.updateUsers(userServiceValueObject);
        }       

        protected function delete_btn_clickHandler(event:MouseEvent):void
        {
            // TODO Auto-generated method stub
            usersService.deleteUsers(dataGrid.selectedItem.id);
        }


        protected function update_btn_clickHandler(event:MouseEvent):void
        {
            // TODO Auto-generated method stub
            //var users:Users = new Users();
            userServiceValueObject.id = parseInt(idTextInput.text);
            userServiceValueObject.firstname = firstnameTextInput.text;
            userServiceValueObject.lastname = lastnameTextInput.text;
            userServiceValueObject.email = emailTextInput.text;
            userServiceValueObject.username = usernameTextInput.text;
            userServiceValueObject.password = passwordTextInput.text;
            userServiceValueObject.joindate = joindateDateField.selectedDate;
            updateUsersResult.token = usersService.updateUsers(userServiceValueObject);
            //usersService.updateUsers(userServiceValueObject);
            usersService.getAllUsers();
            //usersService.updateUsers(userServiceValueObject);
        }

        //protected function updateUsers(item:Users):void
        //{
        //  updateUsersResult.token = usersService.updateUsers(item);
        //}

        protected function dataGrid_clickHandler(event:MouseEvent):void
        {
            // TODO Auto-generated method stub
            idTextInput.text = dataGrid.selectedItem.id;
            firstnameTextInput.text = dataGrid.selectedItem.firstname;
            lastnameTextInput.text = dataGrid.selectedItem.lastname;
            emailTextInput.text = dataGrid.selectedItem.email;
            usernameTextInput.text = dataGrid.selectedItem.username;
            joindateDateField.text = dataGrid.selectedItem.joindate;
        }


        protected function revert_btn_clickHandler(event:MouseEvent):void
        {
            // TODO Auto-generated method stub
            usersService.getDataManager(usersService.DATA_MANAGER_USERS).revertChanges();
        }


        protected function save_btn_clickHandler(event:MouseEvent):void
        {
            // TODO Auto-generated method stub
            usersService.commit();
        }


        protected function create_btn_clickHandler(event:MouseEvent):void
        {
            // TODO Auto-generated method stub
            //datatestService.createDatatest(datatest);
            //datatestService.getAllDatatest();
            //usersService.createUsers(userServiceValueObject);
            //usersService.getAllUsers();
            //var users:Users = new Users();
            //users.id = parseInt(idTextInput.text);
            userServiceValueObject.firstname = firstnameTextInput.text;
            userServiceValueObject.lastname = lastnameTextInput.text;
            userServiceValueObject.email = emailTextInput.text;
            userServiceValueObject.username = usernameTextInput.text;
            userServiceValueObject.password = passwordTextInput.text;
            userServiceValueObject.joindate = joindateDateField.selectedDate;
            //createUsersResult.token = 
            usersService.createUsers(userServiceValueObject);
            usersService.getAllUsers();
            //dataGrid.
        }


    ]]>
</fx:Script>
<s:states>
    <s:State name="Login"/>
    <s:State name="LoggedIn"/>
</s:states>

<fx:Declarations>
    <!-- Place non-visual elements (e.g., services, value objects) here -->
    <customuserclass:CustomUserClass id="customUserClass" fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)" showBusyCursor="true" />
    <s:CallResponder id="sayHelloResult"/>
    <s:CallResponder id="loginResult" result="loginResultEvent(event)"/>


    <usersservice:UsersService id="usersService" fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)" showBusyCursor="true"/>
    <valueObjects:Users id="userServiceValueObject"/>
    <s:CallResponder id="getAllUsersResult"/>
    <s:CallResponder id="createUsersResult"/>
    <s:CallResponder id="deleteUsersResult"/>
    <s:CallResponder id="updateUsersResult"/>       

</fx:Declarations>

<s:Panel width="250" height="140" verticalCenter="0" horizontalCenter="0" title="Login" includeIn="Login">
    <s:layout>
        <s:BasicLayout/>
    </s:layout>
    <s:TextInput x="87" y="10" id="username_txt" width="151" text="jguthrie"/>
    <s:TextInput x="87" y="40" id="password_txt" width="151" text="test"/>
    <s:Label x="10" y="10" text="Username:" fontSize="14"/>
    <s:Label x="10" y="44" text="Password:" fontSize="14"/>
    <s:CheckBox x="10" y="68" label="Remember Me"/>
    <s:Button x="168" y="69" label="Login" id="login" click="doLogin(event)"/>
</s:Panel>
<s:Label includeIn="LoggedIn" x="836" y="10" text="Manage Users:" fontSize="20"/>
<mx:DataGrid includeIn="LoggedIn" x="289" y="31" id="dataGrid" click="dataGrid_clickHandler(event)" creationComplete="dataGrid_creationCompleteHandler(event)" dataProvider="{getAllUsersResult.lastResult}" editable="true" itemEditEnd="dataGrid_itemEditEndHandler(event)">
    <mx:columns>
        <mx:DataGridColumn headerText="id" dataField="id"/>
        <mx:DataGridColumn headerText="username" dataField="username"/>
        <mx:DataGridColumn headerText="firstname" dataField="firstname"/>
        <mx:DataGridColumn headerText="lastname" dataField="lastname"/>
        <mx:DataGridColumn headerText="email" dataField="email"/>
        <mx:DataGridColumn headerText="joindate" dataField="joindate"/>
    </mx:columns>
</mx:DataGrid>
<mx:Form includeIn="LoggedIn" x="289" y="258">
    <mx:FormItem label="Id">
        <s:TextInput id="idTextInput" text="{userServiceValueObject.id}"/>
    </mx:FormItem>
    <mx:FormItem label="Firstname">
        <s:TextInput id="firstnameTextInput" text="{userServiceValueObject.firstname}"/>
    </mx:FormItem>
    <mx:FormItem label="Lastname">
        <s:TextInput id="lastnameTextInput" text="{userServiceValueObject.lastname}"/>
    </mx:FormItem>
    <mx:FormItem label="Email">
        <s:TextInput id="emailTextInput" text="{userServiceValueObject.email}"/>
    </mx:FormItem>
    <mx:FormItem label="Username">
        <s:TextInput id="usernameTextInput" text="{userServiceValueObject.username}"/>
    </mx:FormItem>
    <mx:FormItem label="Password">
        <s:TextInput id="passwordTextInput" text="{userServiceValueObject.password}"/>
    </mx:FormItem>
    <mx:FormItem label="Joindate">
        <mx:DateField id="joindateDateField" selectedDate="{userServiceValueObject.joindate}"/>
    </mx:FormItem>
</mx:Form>
<mx:Form includeIn="LoggedIn" x="536" y="258">
    <mx:FormItem label="CreateUsers">
        <s:TextInput id="createUsersTextInput" text="{createUsersResult.lastResult as int}"/>
    </mx:FormItem>
</mx:Form>
<s:HGroup includeIn="LoggedIn" x="289" y="221" width="602" height="33">
    <s:Button includeIn="LoggedIn" label="Create" id="create_btn" click="create_btn_clickHandler(event)"/>
    <s:Button includeIn="LoggedIn" label="Update" id="update_btn" click="update_btn_clickHandler(event)"/>
    <s:Button includeIn="LoggedIn" label="Revert Update" id="revert_btn" click="revert_btn_clickHandler(event)"/>
    <s:Button includeIn="LoggedIn" label="Save Update" id="save_btn" click="save_btn_clickHandler(event)"/>
    <s:Button includeIn="LoggedIn" label="Delete" id="delete_btn" click="delete_btn_clickHandler(event)"/>
</s:HGroup>

  • 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-14T22:04:01+00:00Added an answer on May 14, 2026 at 10:04 pm

    I had this error, and my search led me to a note saying that message comes back when PHP is throwing an error. A quick look at the end of my PHP log showed what variable I had a typo in, and it was a quick fix after that.

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

Sidebar

Related Questions

I'm trying to build my first cocoa application. done some iPhone developing before. I
this is my first question on here. I'm trying to build a dial control
I am trying to build an silverlight application which takes user first name, last
I am trying to build my first web application. In my app I need
I'm trying to build my first project with the andengine. things work fine so
I am trying to build CppUnit (first line in ReadMe says version 1.13) with
I'm trying to build my first jquery plugin but i get the following error:
I am trying to build a 1.0 version for a web application, and I
I am trying to build my first XML schema validator as a reusable component
I'm trying to build my first localized application. I have all the strings in

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.