Jump to content

Create tunimenuitem dinamic in hyperserver


Wilton Ergon

Recommended Posts

I'm having trouble creating dynamic menus running on the hyperserver, when application runs as standalone, no problem occurs, someone is going through it, this also only occurs when the menu is created in a frame, and pointed to a tunimenubutton, when the menu is created on a form, not the problem.

 

I will try to create an example for support simulate this, the problem started after I put to run on hyperserver, I continue using the version 1552

i noticed several errors in the browser console, this does not occur in stand alone mode (in host location)

my code function in mainmodule!

PROCEDURE TUniMainModule.MontaArvoreLocalizacao(Menu:TuniMenuItem;somenteAtivos:boolean;selectreport:string);
var MenuRelatorio:TUniMenuItem;
    qPastas:TMSQuery;
BEGIN

 

  try
    qPastas            :=TMSQuery.Create(UniApplication);
    qPastas.Connection :=UniMainModule.dbsmain;
    qPastas.close;
    qPastas.SQL.Text :=selectreport;
    qPastas.Open;

    MenuRelatorio         :=TuniMenuItem.Create(UniApplication);
    MenuRelatorio.Caption :='-';
    UniMainModule.Global_ContadorMenu :=UniMainModule.Global_ContadorMenu+1;
    MenuRelatorio.Name    :='MenuItem'+IntToStr(UniMainModule.Global_ContadorMenu);
    UniMainModule.Global_ContadorMenu :=UniMainModule.Global_ContadorMenu+1;
    Menu.Add(MenuRelatorio);
    UniMainModule.Global_ContadorMenu :=UniMainModule.Global_ContadorMenu+1;
    while not qPastas.Eof do
      Begin
        MenuRelatorio         :=TuniMenuItem.Create(self);//UniApplication);
        MenuRelatorio.Caption :=qPastas.FieldByName('modulo').AsString+'| Qtde:'+qPastas.FieldByName('REG').AsString;
        MenuRelatorio.Name    :='MenuItem'+IntToStr(UniMainModule.Global_ContadorMenu);
        UniMainModule.Global_ContadorMenu :=UniMainModule.Global_ContadorMenu+1;
        menurelatorio.Hint    :=IIF(somenteAtivos,'1','0');
        MenuRelatorio.OnClick :=ExecClickRelatorioMenu;
        menurelatorio.Hint    :='MODULO';
        MenuRelatorio.Tag     :=0;
        Menu.Add(MenuRelatorio);
        qPastas.Next;
      End;
  finally
    freeandnil(qpastas);
  end;

end;

 

 

 

image.thumb.png.62a42eba4f1b71aafc0bd2e7ce16f801.png

 

 

 

Link to comment
Share on other sites

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...