1 (edited by tcoton 2015-05-13 13:32:26)

Topic: Auto-load by script issue

Hi there,


I am facing a strange issue with a script which loads automatically informations in grids using scripts ( auto click on form show)

this works perfectly well with already existent object created prior 1.51 but the one created using 1.51 does not refresh

// Load automatically information into grids in form1 + operator tracking
procedure Form1_OnShow (Sender: string; Action: string);
var
sCurrentDate: string;
begin
    sCurrentDate := '"' + FormatDateTime('yyyy-MM-DD hh:nn:ss.000', now) + '"';
    SQLExecute ('INSERT INTO WindowsID (DateTime, AccountID)' + 'VALUES (' +sCurrentDate+', '+ sUserName +')');
    Form1.LastUser_Grid.dbUpdate;
    Form1.Button1.Click;
    Form1.Chk_restage.Click;
    Form1.Chek_quarantine.Click; // the only one which does not work -- added using 1.51




    // Display Release Note (About) with select in database
    Form1.MemoAbout.Text := SQLExecute('SELECT Rel_Note FROM Release WHERE id=1');
    Form1.MemoAbout.ScrollBars := ssVertical; // The component has a single scroll bar on the right edge.

end;

The Form1.Chek_quarantine.Click does not refresh autiomatically when I make changes whereas the others work perfectly well.

To refresh the grid, I have to reload the application!

Any hint?

Re: Auto-load by script issue

I used another procedure to make it working but it looks more like a workaround as i see nothing preventing it to work properly in the above script...

   //Auto count status + Quarantine refresh
procedure Form1_GridSearch_OnChange (Sender: string);//Load automatically information into grid form1.ReadyGrid on change
begin
    Form1.Button1.Click;
    Form1.Chek_quarantine.Click;
end;

Re: Auto-load by script issue

Hello tcoton

When you say : No refresh, do you mean that your grid doesn't display next record ?

If so, why don't use MyGrid.Update behind an OnAfterClick event ?

JB

Re: Auto-load by script issue

tcoton
Please, send me your project to support@drive-software.com

Dmitry.

Re: Auto-load by script issue

Hi Jean.brezhonek,

I would like the grid to refresh every time the form is shown as it works with "Form1.Chk_restage.Click". Currently to refresh the 3rd grid(Quarantine), I had to reload the application so I added the "grid on change" for Form1.Chek_quarantine.Click to reload on every change.

The strange thing is that I do not need the "grid on change" for the 2nd grid (Chk_restage).

I will send the project to Dmitry for close examination.

Re: Auto-load by script issue

tcoton
I have not received the project from you.

Dmitry.

Re: Auto-load by script issue

Dmitry

I sent it to you yesterday evening smile