Jump to content

TSeba

uniGUI Subscriber
  • Posts

    28
  • Joined

  • Last visited

Posts posted by TSeba

  1. Hi, is there any way to put all the components inside a UniGroupBox in read-only mode (or not) instead of doing it one by one?
    If the property enabled on the UniGroupBox is used, all components are gray and their visualization is difficult.

    Thanks in advance

  2. Hi
    Within the Demo projects there is one called GridEditors (gedit.dproj). If in that project I want to insert a new record and in the column "Hire Date" I enter manually for example "45/45/4545" and then press the Tab key automatically cancels the record that I am registering. While I am loading the wrong date, it generates the hint with the error message, but it would be good if I generated that message when I left and did not cancel the registration. The same happens with the modification, if I manually change a date in the "Hire Date" field to an incorrect value, the edition is canceled.

    Thanks

  3. Hi!

    I have a UniDbGrid in a project and one of the columns has a TDateTime field and it has an associated UniDateTimePicker in the Editor property.
    When the program is executed and I insert a new record, in the date field if I report an incorrect date value, the behavior is that I cancel the record that I am loading instead of generating a message informing that the date entered is incorrect. How can I avoid canceling the registration and generating the message with the error and the possibility for the user to correct it?.

    Thanks in advance

  4. Hi:

    Could you help me with the following problem: I have an Editor (UniDateTimePicker component) associated with a column of a UniDbGrid. One of the validations when saving the record is that the Date field ("Comienzo" in the attached example) does not have a loaded date. If it has the loaded date, it generates a message warning the user of this and makes an "Abort" command so that it does not perform the saving. Now, if in the "Comienzo" column I erase the date, leaving the field visually empty, when I want to save the record again, the field still has the original value, it is not deleted even if the data in the column has been deleted.

    I have attached a small project where I reply a problem (PruebaEditor.zip).
    I also attach a txt file with the creation script of an interbase table with a single data record (EmFechasLiquidacion.txt).
    The steps to reproduce the error are the following:

    1 - Relate IBCConnection1 with the database where the EmFechasLiquicacion table was added and connect it.
    2 - Activate the IbcTable1 component
    3 - Run the project, press Edit and then Save in the Navigator Component and the error message will be generated.
    4 - Close the error message, delete the date in the "Start" field and then save again and the message will reappear because the "Start" field still has the date originally loaded.

    Thanks in advance

    PruebaEditor.zip

    EmFechasLiquidacion.TXT

  5. Hi,

     

    I have an error detected using UniDbGrid (TUniDbGrid) related to an Interbase table.

    Also I am using Delphi 10.2 Tokyo with Unigui version 10.0.1472.

    In a column where Integer type values ​​are loaded (the same happens with Float type fields), if I insert the value 0 (zero) when validating the previous record of its insertion in the table, the IsNull function returns the value True.

     

    The exact validation done in the BeforePost event of the table is as follows:

     

    If TableName.FieldByName ('AmountFrom'). IsNull then

      ShowMessage ("You must enter an amount greater than or equal to 0")

     

    The problem is that if I charge amount = 0 the, when doing the previous validation I get the message that I must enter an amount because of the IsNull function returns TRUE. If 0.01 is reported (or any value other than 0) the IsNull function returns FALSE.

     

    I did the same test using DbGrid (TDbGrid) and the "IsNull" function worked correctly returning TRUE if nothing was actually entered in the column and FALSE if 0 (zero) was loaded so the problem is not at the database level.

     

    In this case I am not using querys but I use the TIBCTable and TIBCDataSource components of Devart.

     

    Thanks in advance

  6. On the DB level there is always differentiation between NULL and 0.

     

    But the .IsNull function obviously does not work that way.

     

    What if you try,

    If length(TableName.FieldByName('AmountFrom').AsString)=0 then
      ShowMessage ("You must enter an amount greater than or equal to 0")
    

    Then you only check for NULL (no value) and not 0.

     

    Thanks for the answer but this does not work for me because if it has the value 0 loaded the length of the field is 0 and it really is not. Obviously this is a problem of the components of Devart that I am using. I'm going to have to consult them. Thanks again

  7. Hi,

    I am using a UniDbGrid that is related to an Interbase table. The UniDbGrid columns show the information of the fields in the table. When inserting a record in that grid and before inserting itself into the interbase table, a series of validations is made, one of those validations is that a field (In this case, Amount From) can be loaded amounts greater than or equal to 0 and is correct. These validations are executed before registering the record in the table

     

    If TableName.FieldByName ('AmountFrom'). IsNull then

      ShowMessage ("You must enter an amount greater than or equal to 0")

     

    The problem is that if I charge amount = 0 the, when doing the previous validation I get the message that I must enter an amount because the IsNull function returns TRUE. This is not correct since the field has the value 0 and therefore is not null. If 0.01 is reported (or any value other than 0) the message does not appear because the IsNull function returns FALSE.

     

    In this case I am not using querys but I use the TIBCTable and TIBCDataSource components.

     

    I hope it was clearer.

     

    Thank you

  8. Hi:

     

    I have the following problem when trying to validate the data of a record in an Interbase table. At the time of the Post, valid if one of the fields you are entering is Null or less than 0 (zero). I evaluate if it is null using the IsNull function, the problem that if you enter 0 (zero) in the registry the IsNull function returns False when it should be True.

    I've already tried using the Permanent Field format or using the FielbByName function and the result is the same.

    It is important to add that the 0 can be a valid value, not the Null value.

    I am working with Delphi Tokyo and Unigui version 1.10.0.1471.

    Any idea how to fix this?.

     

    Thanks in advance for your help

  9. Hi, I add more information that I hope will clarify my problem.

    The error "TableName: Field" Company; Agreement "not found" is generated when the Post is made, not when the information is displayed in the grid. And it appears in the case that I want to change the value of the Lookup field in the record.

     

    I could also see that the Demo project "DBLookupCombo" works correctly but has a single key field in "KeyField". I attach an image of my project where you can see that both the property "KeyFields" and the property "LookupKeyFields" have 2 fields of the tables (in this case "Empresa;ObraSocial").

     

     post-5349-0-76829800-1525791321_thumb.jpg

  10. Hi, I have the following problem. When I want to modify in a form a Lookup field that has more than one field defined in LookupKeyFields (Ex: "Company; Agreement") the error "TableName: Field" Company; Agreement "not found" is generated. That error does not occur when there is a single field in LookupKeyFields. Any idea why this error occurs and how can I solve it? ... I have cases that I need to define 2 or more fields in LookupKeyFields and in the version of delphi 7 I worked correctly.

    I am using Delphi 10.2 Tokyo with version 1.10.0.1453 of Unigui.

     

    Thanks in advance

  11. Yes, I saw that example and to see if I can be clearer I copy the procedure to clean the filters:

     

    Procedure TMainForm.UniDBGrid1ClearFilters (Sender: TObject);

    Var

      I: Integer;

    Begin

      If UniMainModule.ADOQuery1.Active then

      Begin

        For I: = 0 to UniMainModule.ADOQuery1.Parameters.Count-1

          UniMainModule.ADOQuery1.Parameters .Value: = '%%';

     

        UniMainModule.ADOQuery1.Requery;

      End;

    End;

     

    Suppose I comment on the whole procedure:

     

    Procedure TMainForm.UniDBGrid1ClearFilters (Sender: TObject);

    Var

      I: Integer;

    Begin

      {If UniMainModule.ADOQuery1.Active then

      Begin

        For I: = 0 to UniMainModule.ADOQuery1.Parameters.Count-1

          UniMainModule.ADOQuery1.Parameters .Value: = '%%';

     

        UniMainModule.ADOQuery1.Requery;

      End; }

    End;

     

    When you press the delete button on the left, and as the procedure is commented, the grid information is obviously not restored, but the texts entered in the columns are deleted. This behavior, the one to delete the texts of the columns, is what I have to replicate from a TButton.

     

    I think it has nothing to do but I am not using Querys but I use AdsTables.

     

    Regards.

  12. Hi, 

     

    It is correct what I say but that does not delete the filters that is what I am missing.
    I tested by adding the following inside the Clean Button:
     
    UniSession.AddJS (UniDbGdDatos.JSName + '.store.clear ();');
     
    But at runtime I get the error "XXXX.store.clear is not a function". That JS code is what I'm missing seems to me.
     
    Regards.
    • Upvote 1
  13. Hi, 

    I hope I can clarify what I need

    I'm using a UniFormGrilla. When loading the grid that is associated with an advantage table, filters are automatically generated for each column by executing the following procedure:

     

    Var

      I: Integer;

      VTUniEdtTemp: TUniEdit;

    Begin

      For I: = 0 to UniDbGdDatos.Columns.Count - 1 of

      Begin

        If (UniDbGdDatos.Columns .FieldName <> 'Company') then

        Begin

            VTUniEdtTemp: = TUniEdit.Create (Self);

            VTUniEdtTemp.Parent: = UniHiPnFilters;

            VTUniEdtTemp.EmptyText: = UniDbGdDatos.Columns .FieldName + '...';

            VTUniEdtTemp.Name: = 'UniEdt' + UniDbGdDatos.Columns .FieldName;

            UniDbGdDatos.Columns .Filtering.Editor: = vTUniEdtTemp;

            UniDbGdDatos.Columns .Filtering.Enabled: = true;

        End

        Else

          Begin

           UniDbGdDatos.Columns .Visible: = false;

          End;

      End;

    End;

     

    In summary, I need to be able to simulate at runtime the JS function that is executed by pressing the button dgFilterCrearButton but from another Button?.

     

    Regards.
×
×
  • Create New...