Lai,Risheng
2023-11-02 30c02e0c981b16be0918483543f4b812956c45d4
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
Quintiq file version 2.0
#parent: DataHolderLaneLeg
Response OnDataChanged () id:Response_DialogCreateEditFeedbackTrip_DataHolderLaneLeg_OnDataChanged
{
  #keys: '[146140.0.266892536]'
  CanBindMultiple: false
  DefinitionID: 'Responsedef_WebComponent_OnDataChanged'
  GroupServerCalls: true
  Precondition:
  [*
    return this.Data().Size() > 0
  *]
  QuillAction
  {
    Body:
    [*
      // This dataholder solve a problem with dialogs. When the user change an unit, a red cross was appearing on 
      // the dropdown list lane leg during a really short time. This is due the fact that we are setting
      // the dropdownlistlaneleg.data( null(LaneLeg ) ).
      // If the Dialog data does not persist in the lane leg selection of the new unit, auto select 
      // the first available lane leg. Else, keep the lane leg selection
      
      if( not isnull( DataHolderDialogData.Data().LaneLeg() ) )
      {
        if( this.Data().Find( DataHolderDialogData.Data().LaneLeg() ) < 0 )
        {
          DropDownListLaneLeg.Data( this.Data().Element( 0 ) );
        }
        else
        {
          DropDownListLaneLeg.Data( DataHolderDialogData.Data().LaneLeg() ); 
        }
      }
    *]
  }
}