hongji.li
2023-11-07 1a1ba3ad5ed9e4380185aa1ccad20204a0e5f115
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
Quintiq file version 2.0
#parent: #root
Method UIShowHideComponentForBatchEdit (
  Boolean isInit,
  Boolean isBatchEdit
) id:Method_DialogCreateEditBaseRecipeIngredient_UIShowHideComponentForBatchEdit
{
  #keys: '[135040.0.219771730]'
  Body:
  [*
    // Handles the toggling of the batch related component
    if(  isInit )
    {
      //for initialize, control batch checkboxes visibility
      
      CheckboxBatchMin.Visible( isBatchEdit );
      CheckboxBatchMax.Visible( isBatchEdit );
      CheckboxBatchNom.Visible( isBatchEdit );
      
      //disable all other component  
      if( isBatchEdit )
      {
        //do nothing, becasue all component is batch-editable
      } 
    }
    
    //batch Min
    batchValidMin := ifexpr( isInit
                            ,not isBatchEdit //when isBatchEdit,default=disable all
                            ,CheckboxBatchMin.Checked() 
                           );
    EditFieldMin.Enabled( batchValidMin, "" );
    
    
    //batch Max
    batchValidMax := ifexpr( isInit
                            ,not isBatchEdit //when isBatchEdit,default=disable all
                            ,CheckboxBatchMax.Checked() 
                           );
    EditFieldMax.Enabled( batchValidMax, "" );
    
    //batch Nom
    batchValidNom := ifexpr( isInit
                            ,not isBatchEdit //when isBatchEdit,default=disable all
                            ,CheckboxBatchNom.Checked() 
                           );
    EditFieldNom.Enabled( batchValidNom, "" );
  *]
}