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, "" );
  *]
}
