locked
HTML acccess and update issue with multiple tables RRS feed

  • Question

  • I know this should be simple and was in C# but I’m having issues in HTML being able to update a Totals table.  I have Activities by year for an employee with Totals for that year’s activities.  When I add a new activity I am having a problem simply being able to add the money amount of that activity to the total’s table for that employee.  I put an addChangeListener in for when the activity amount changes. It works to a point, but I seem to be unable to get to and update the total money field in the total table.  It keeps coming up as undefined.    I tried dataBind in postRender for both the activity and totals.  In debug mode they both show the data is loaded.  But again how is a good method to update the total table.  I know there is something really simple that I am missing but any help would be greatly appreciated.

    //  ****************Listen for changes to Activity Amount *************

        screen.Activity.addChangeListener("dActAmt", function (e) {

            // Get the Activity Amount that was just entered

            var xActAmt = screen.Activity, contentItem = screen.findContentItem("dActAmt");

            // Get the Total Amount from the Totals Records

            var xTotAmt = screen.SelectedTotalsByYear, contentItem = screen.findContentItem("selectedItem.tTotAmt");

            if (xActAmt.details.entityState === msls.EntityState.added) {

               //msls.showMessageBox("dActAmt = " + xActAmt.dActAmt + "  xTotAmt = " + xTotAmt);

            }

        })

    };

    Wednesday, August 20, 2014 10:29 PM

All replies

  • Where is this call that you are making?  In the created of the screen?

    I'm having a hard time following how these tables work together, could you post the contents of each table after you have added 3 Activities for an employee?  (i.e. show the contents of both tables, for this particular employee after each Activity is created).  That would help clear up what you are trying to do and I can better answer your question.

    David Kidder | Senior SDET | Microsoft | LightSwitch

    Friday, August 22, 2014 5:08 PM
    Moderator