Jump to content

Recommended Posts

Posted

Hello,

 

in Webmode - the TUniMainModule.OBJEKTAfterScroll - Message ist send multi times..

  • Is it a bug or did i something wrong ?

i have 3 tabel and 3 grids - every table has a "afterScroll"..

 

 

If you select a row in PERSON :

TUniMainModule.PERSON AfterScroll -> SELECT * FROM VERTRAG

TUniMainModule.VERTRAG AfterScroll ->  SELECT * FROM OBJEKT

TUniMainModule.OBJEKT AfterScroll ->  uniMEMO.lines.append - 4 Events will be create !

 

 

Please have a look at the attached images of a small demo - i named the images with informations.

 

i have:

  • Main
  • Mainmodule
  • Servermodule

 

 

Main:

implementation


{$R *.dfm}


uses
  uniGUIVars, MainModule, uniGUIApplication,ServerModule;


function MainForm: TMainForm;
begin
  Result := TMainForm(UniMainModule.GetFormInstance(TMainForm));
end;


procedure TMainForm.UniFormShow(Sender: TObject);
begin
 UniMainModule.ZConnection1.Connect;
 UniMainModule.PERSON.SQL.Clear;
 UniMainModule.PERSON.SQL.add('SELECT * FROM PERSON ');
 UniMainModule.PERSON.Open;
end;


initialization
RegisterMainFormClass(TMainForm);
end.

Mainmodule:

implementation

{$R *.dfm}

uses
  UniGUIVars, ServerModule, uniGUIApplication, main;


function UniMainModule: TUniMainModule;
begin
  Result := TUniMainModule(UniApplication.UniMainModule)
end;


procedure TUniMainModule.OBJEKTAfterScroll(DataSet: TDataSet);
begin
    main.MainForm.UniMemo1.Lines.Append(timetostr(now));
end;


procedure TUniMainModule.PERSONAfterScroll(DataSet: TDataSet);
begin


    VERTRAG.SQL.Clear;
    VERTRAG.SQL.add('SELECT * FROM VERTRAG WHERE ID_PERSON = '+PERSON.fieldbyName('ID_PERSON').AsString);
    VERTRAG.Open;


end;


procedure TUniMainModule.VERTRAGAfterScroll(DataSet: TDataSet);
begin


  if (VERTRAG.RecordCount > 0) then
        begin


            OBJEKT.SQL.Clear;
            OBJEKT.SQL.add('SELECT * FROM OBJEKT WHERE ID_VERTRAG = '+VERTRAG.fieldbyName('ID_VERTRAG').AsString);
            OBJEKT.Open;
        end
        else
        begin
            OBJEKT.SQL.Clear;
            OBJEKT.SQL.add('SELECT * FROM OBJEKT WHERE ID_VERTRAG = -1');
            OBJEKT.Open;
        end;




end;


initialization
  RegisterMainModuleClass(TUniMainModule);
end.

Servermodule:

implementation


{$R *.dfm}


uses
  UniGUIVars,
  mainmodule;


function UniServerModule: TUniServerModule;
begin
  Result:=TUniServerModule(UniGUIServerInstance);
end;

procedure TUniServerModule.FirstInit;
begin
  InitServerModule(Self);
end;

initialization
  RegisterServerModuleClass(TUniServerModule);
end.

 

post-1295-0-19887000-1375197696_thumb.jpg

post-1295-0-99153900-1375197697_thumb.jpg

post-1295-0-71980500-1375197699_thumb.jpg

Posted

Hello Farshad Mohajeri,

 

thank you for your replay.

 

First of all: Thank you for your great work ! As a Delphi-programmer, i am realy grateful in your efforts with uniGUI !

 

@AfterScroll:

 

in my Test-Application, i display different input-frames depending on the recordtype.

for this, i use "insertFrame"  on "AfterScroll" ...

First i thought, i made a mistake by creating the frames - but it was the 4-times creating in short time, which was called in the "AfterScroll" Event...

 

For me, it would be nice - when the "AfterScroll" -Event would be send just 1 timer.

 

Thank You

Erich

  • Administrators
Posted

Hello Farshad Mohajeri,

 

thank you for your replay.

 

First of all: Thank you for your great work ! As a Delphi-programmer, i am realy grateful in your efforts with uniGUI !

 

@AfterScroll:

 

in my Test-Application, i display different input-frames depending on the recordtype.

for this, i use "insertFrame"  on "AfterScroll" ...

First i thought, i made a mistake by creating the frames - but it was the 4-times creating in short time, which was called in the "AfterScroll" Event...

 

For me, it would be nice - when the "AfterScroll" -Event would be send just 1 timer.

 

Thank You

Erich

 

I need a testcase. Please add a report to Bug Reports forums.

 

Thanks

Posted

Hi Erich

 

Why you can't use a mastersrouce relation between datasets, and when you move in person table it will show in the vertrag grid the corresponding records and so on in objtek.?

 

Liriano

Posted

Hello Liriano,

 

if i use "afterScroll" - the performance is higher ( ca 25 %)

and i can use more complex SQL-Statements with station_id, user_id .. and some other informations ..

a fix relation is not given in some situations 

 

 

as a small example:

  • show all contracts from person_1 and allso all contracts where the actual user has 25% participation ..

 

i think - the "afterScroll"-Event is the right place for such SQL-Statements 

 

Nice Greerings from the hot (29 Degree celsius) Salzburgerland :-)

  • Upvote 1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...