Jump to content

skafy

uniGUI Subscriber
  • Posts

    216
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by skafy

  1. 39 minutes ago, irigsoft said:

    I am sorry i have changed my post.

    Please try to set color on Form.OnReady.

    I use addJS on OnButtonClick. (Form and all components are already created)

    I've managed to change colors now in FormReady event. Thank you for your help.

    So I've created buttons in FormCreate event end than find them on FormReady event end change their color.

    procedure TDetail.ChangeButtonColors(APanel: TUniPanel);
    var
      Name: string;
      Color: string;
    begin
      UniMainModule.qryGETButtons.Close;
      try
        UniMainModule.qryGETButtons.Prepare;
        UniMainModule.qryGETButtons.Open;
        UniMainModule.qryGETButtons.First;
        while not UniMainModule.qryGETButtons.Eof do
        begin
          Name:= UniMainModule.qryGETButtons.FieldByName('NAME').AsString;
          Color:= UniMainModule.qryGETButtons.FieldByName('COLOR').AsString;
    
          var Button: TUniButton;
          Button:= (APanel.FindComponent(Name) as TUniButton);
          if Assigned(Button) then
            uniSession.AddJS ('document.getElementById("' + Button.JSId + '").style.background = "' + Color + '";');
          
          UniMainModule.qryGETButtons.Next;
        end;
      finally
        UniMainModule.qryGETButtons.Close;
      end;
    end;

    Thanks again

    • Like 1
  2. I'm getting below error. If I debug JSid has value.

     

    image.png.e37077dd40c70e2b6b1b3e58684530a3.png

     

    Code:


     

    procedure TDetail.ShowButtons(APanel : TUniPanel);
    var
      Name: string;
      Color: string;
      Align: string;
    begin
      UniMainModule.qryGETButtons.Close;
      try
        UniMainModule.qryGETButtons.ParamByName('TASKINS_ID').AsInteger:= Taskins_ID;
        UniMainModule.qryGETButtons.Prepare;
        UniMainModule.qryGETButtons.Open;
        while not UniMainModule.qryGETButtons.Eof do
        begin
          Name:= UniMainModule.qryGETButtons.FieldByName('NAME').AsString;
          Color:= UniMainModule.qryGETButtons.FieldByName('COLOR').AsString;
          Align:= UniMainModule.qryGETButtons.FieldByName('ALIGN').AsString;
    
          var Button: TUniButton;
          Button:= TUniButton.Create(Self);
          Button.Parent:= APanel;
          Button.AlignWithMargins:= True;
          Button.Caption:= Name;
          uniSession.AddJS ('document.getElementById("' + Button.JSId + '").style.background = "red";');
    
          if Align = 'Left' then
            button.Align:= alLeft
          else if Align = 'Center' then
            button.Align:= alClient
          else if Align = 'Right' then
            button.Align:= alRight;
    
          UniMainModule.qryGETButtons.Next;
        end;
      finally
        UniMainModule.qryGETButtons.Close;
      end;
    end;

     

  3. Hi, I'm having problem how to read value after I Select a value on my Combobox Editor in Grid column.
     

    
    procedure TMainForm.UniDropDownSelect(Sender: TObject);
    begin
      ShowMessage('UniDropDownSelect' + TUniComboBox(Sender).Items.Strings[ TUniComboBox(Sender).ItemIndex]);
    end;
    
    
    procedure TMainForm.FDQuery1AfterOpen(DataSet: TDataSet);
    var
      lala: TUniComboBox;
    begin
      lala:= TUniComboBox.Create(Self);
      lala.Items.Add('lala1');
      lala.Items.Add('lala2');
      lala.OnSelect:= UniDropDownSelect;
    
      UniDBGrid1.Columns.ColumnFromFieldName('COL1').Editor:= lala;
    end;

     The UniDropDownSelect allways returning Item Index of -1.

     

    How can I retrive value after it vas selected.?

  4. I'm pretty sure. I won't install 1506 again. I have a project and didn't work on port 8077. I than downloaded 1504 and run the same project and it worked.

    Are you able to run your project on port 8077 on 1506 build?

  5. Hi i'm having problems with ports. I've set unigui to run on 8077, but only way i can access application is on 80.

     

    Quote

    Workflow.exe: 00003634: 08:13:22 []:>--------------------------------------------------------------<
    Workflow.exe: 00003634: 08:13:22 [TUniServerModule]:Server First Init.
    Workflow.exe: 00003634: 08:13:22 [TUniServerModule]:Debug Mode = ON
    Workflow.exe: 00003634: 08:13:22 [TUniServerModule]:Global Cache Folder Erased. <10> Files deleted.
    Workflow.exe: 00003634: 08:13:23 [TUniServerModule]:Starting HTTP Server on Port: 8077...
    Workflow.exe: 00003634: 08:13:24 [TUniServerModule]:HTTP Server Started on Port: 8077

     

    But when I open browser, localhost on 8077 is blank. Where I find the aplication is on port 80 -> https://localhost/

     

    Whant seems to be the problem?

     

    EDIT:

    the problem occurs on 1506 build. on 1504 works great. Its also imposible to go to HTTP page. Only SSH works.

  6. I think i managed to solve it by setting DataSource field at its value and not selecting ListSource value. something like that

     

    UniDBLookupComboBox1.DataSource.DataSet.FieldByName(UniDBLookupComboBox1.DataField).AsString:= UniDBLookupComboBox1.ListSource.DataSet.FieldByName(UniDBLookupComboBox1.ListField).AsString

     

    but I still moved from DBLookupCombobox to DBComboBox for better managing of data.

     

    Hope it helps

  7. Hi,

     

    I'm having problems with assignment of a dblookupcombobox's value. I yould like to auto fill dblookupcombobox if there is only one record. I cannot find out how.
     

    if dsData.DataSet.RecordCount = 1 then
      begin
        dsData.DataSet.First;
        dblookup.KeyValue := dsData.DataSet.FieldByName(dblookup.KeyField).AsVarit;
      end;

    when i check dsData.DataSet.RecordCount there is more than 0 values. how can i achive this.

  8. HI,

    I'm having problems with tabOrders in my controls that i make on the fly. I create 10 UniEdit fields (panel1) and when I click on one field and press tab tab,order is cycled between already created buttons. I attach simple case.

    I want that when I put cursor on field 1 and pressing tab the tab order is set as fields was created 1,2,3,4,5,...

     

    Please help.

    UniguiTabOrder.7z

  9. I'm having problem showing file from server on PDFFrame. I shared a folder from server with my account like so \\SomeServer\SomeFolder\ . When I try to show some file from shared folder I get massage : Message: file origin does not match viewer's.

    pdfFrame.PdfURL:= '\\SomeServer\SomeFolder\SomeFile.pdf'; 

    is giving me above result. What should be done for resolution?

×
×
  • Create New...