Quintiq file version 2.0
#parent: ListKPISelection
Response OnCreated () id:Response_ListKPISelection_OnCreated
{
  #keys: '[145730.0.991785251]'
  CanBindMultiple: false
  DefinitionID: 'Responsedef_WebComponent_OnCreated'
  QuillAction
  {
    Body:
    [*
      // Restore selection from view data
      if( not isnull( MacroPlan ) )
      {
        json := JSON::Parse( this.ViewData() );
        json_key := KPI::GetViewDataKey( MacroPlan );
        
        // Workaround: OnCheckedChanged empty isnt fired when switching views
        DataHolderSelectedKPI.Data().Flush();
        if( json.Has( json_key ) )
        {
          item_json := json.Get( json_key );
          items := item_json.GetString().Tokenize( FormKPI.GetKPIStringDelimiter() );
        
          traverse( DataHolderActiveScenario.Data(), KPIValue.KPI, kv, exists( items, Elements, e, e = kv.Name() ) )
          {
            // Check the KPI in list
            this.ExtendCheckByKey( kv.Key() );
          }
        }
      }
    *]
    GroupServerCalls: false
  }
}
