Alpha DevCon 2018
Results 1 to 4 of 4

Thread: databound Dialog: GetValue showing value of last edited record instead of new one

  1. #1
    Member
    Real Name
    Jürgen Hämmerle
    Join Date
    Nov 2012
    Posts
    13

    Default databound Dialog: GetValue showing value of last edited record instead of new one

    I have an sql-databound dialog for entering new invoices with a auto-primary key internal_invoice_no.

    After entering and submitting data, the new record is inserted and can be updated afterwards - everything ok.

    I have a grid component showing all invoices and a button to edit these invoices, which opens the same dialog-component, populated with the current grid records internal_invoice number - everything ok.

    If I now close the two TAB-Panes and reopen the one for entering an new invoice, the dialog is empty and I can enter/submit/edit a new invoice - everything ok until here.

    But, if I now use {dialog.Object}.getValue("INTERNAL_INV_NO") I get the invoice number from the last shown invoice (with the edit-button in the grid), although the new invoice number is shown correct on the dialog?

    If I update another field in the invoice, the correct (last added invoice) is updated in database, but {dialog.Object}.getValue("INTERNAL_INV_NO") (and also all other fields in the dialog) show data from previous invoice.

    It seems as if there is a refresh problem.

    Does anyone has an idea to solve this problem? Thank you very much!

  2. #2
    "Certified" Alphaholic TheSmitchell's Avatar
    Real Name
    Sarah
    Join Date
    Apr 2012
    Posts
    1,301

    Default Re: databound Dialog: GetValue showing value of last edited record instead of new one

    Quote Originally Posted by jhguru View Post
    I have an sql-databound dialog for entering new invoices with a auto-primary key internal_invoice_no.

    After entering and submitting data, the new record is inserted and can be updated afterwards - everything ok.

    I have a grid component showing all invoices and a button to edit these invoices, which opens the same dialog-component, populated with the current grid records internal_invoice number - everything ok.

    If I now close the two TAB-Panes and reopen the one for entering an new invoice, the dialog is empty and I can enter/submit/edit a new invoice - everything ok until here.

    But, if I now use {dialog.Object}.getValue("INTERNAL_INV_NO") I get the invoice number from the last shown invoice (with the edit-button in the grid), although the new invoice number is shown correct on the dialog?

    If I update another field in the invoice, the correct (last added invoice) is updated in database, but {dialog.Object}.getValue("INTERNAL_INV_NO") (and also all other fields in the dialog) show data from previous invoice.

    It seems as if there is a refresh problem.

    Does anyone has an idea to solve this problem? Thank you very much!
    Is the button to open the dialog have "cached dialog" checked?
    Alpha Five Version 11 Build 3381-4096
    Alpha Anywhere Version 12.3 Build 2614-4409
    Find me on Github!

  3. #3
    Member
    Real Name
    Jürgen Hämmerle
    Join Date
    Nov 2012
    Posts
    13

    Default Re: databound Dialog: GetValue showing value of last edited record instead of new one

    thank your for your quick reply -no, checkbox "cached dialog" is not checked

  4. #4
    Member
    Real Name
    Jürgen Hämmerle
    Join Date
    Nov 2012
    Posts
    13

    Default Re: databound Dialog: GetValue showing value of last edited record instead of new one

    I have now migrated to Version V12, still having the same effect.

    Perhaps some internal variables are not cleared after opening the dialog "with populate", so by entering an new invoice (in the empty dialog) some variable still has the old primary key value, although the new one is shown in the dialog.

    Here the code which opens the dialog for exsting invoices:

    var windowName = 'WINDOW_6dc55dc3_29e6_4eac_b54f_8a0c593c10bb';
    var currWindow = {Grid.object}.getWindow(windowName);
    var go = new Object();
    go.objectId = objEle.id;
    go.dialog2Name = 'RechnungDialog';
    go.type = 'dialog2';
    go.specialDialogMode = 'populateDialog';
    go.getPKFrom = 'SpecifyNow';
    go.pkValue = {Grid.object}._getValue('G','RECHNUNG',rowNum);
    go.alias = '{Grid.ComponentName}_RechnungDi';
    go.submitCurrentFieldValues = true;
    go.sourceGridPart = 'G';
    go.sourceGridRowNumber = rowNum;
    go.workingMessage = '<img src=\'CSS/A5System/images/wait.gif\' />Working...';
    go.placeholderValues = '';

    ...

Similar Threads

  1. List Control Databound Checkbox
    By Davidk in forum Mobile & Browser Applications
    Replies: 0
    Last Post: 01-28-2014, 11:07 AM
  2. Showing a detail record in an embedded dialog when selecting a grid record
    By Andrewdb in forum Application Server Version 11 - Web/Browser Applications
    Replies: 0
    Last Post: 01-22-2013, 09:39 AM
  3. Update parent calculated fields when child record edited
    By Jeff Fried in forum Alpha Five Version 10 - Desktop Applications
    Replies: 6
    Last Post: 12-18-2012, 04:09 PM
  4. Dialog component not showing correct record
    By info@computoria.nl in forum Application Server Version 11 - Web/Browser Applications
    Replies: 1
    Last Post: 01-31-2012, 11:17 AM
  5. Record the date time a record has been last edited
    By gmurph in forum Application Server Version 10 - Web/Browser Applications
    Replies: 3
    Last Post: 09-13-2011, 10:11 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •