TXDataWebDataSet and FieldByName

Hello,


After a Query I have data in my TXDataWebDataSet. I can see that, because the data are displayed in an DBGrid which has a DataSet which is linked to the TXDataWebDataSet.

Now I try to get Data from a specific field by:
btn_login_abbruch.Text:=Data_Module.xDST_Sprache.FieldByName('btn_login_abbruch').AsString;
btn_login_ok.Text:=Data_Module.xDST_Sprache.FieldByName('btn_login_ok').AsString;

But at runtime I get the error: 
ERROR
Uncaught TypeError: Cannot read property 'GetJSONDataForField$1' of null | TypeError: Cannot read property 'GetJSONDataForField$1' of null at Object.GetFieldData$1 (http://localhost:8000/NedCom_Web/NedCom_Web.js:89295:34) at Object.GetFieldData (http://localhost:8000/NedCom_Web/NedCom_Web.js:76384:21) at Object.GetData (http://localhost:8000/NedCom_Web/NedCom_Web.js:73002:36) at Object.GetAsJSValue (http://localhost:8000/NedCom_Web/NedCom_Web.js:73130:21) at Object.CTimerTimer (http://localhost:8000/NedCom_Web/NedCom_Web.js:95148:136) at Object.cb [as FOnTimer] (http://localhost:8000/NedCom_Web/NedCom_Web.js:222:26) at Object.DoTimer (http://localhost:8000/NedCom_Web/NedCom_Web.js:20633:39) at cb (http://localhost:8000/NedCom_Web/NedCom_Web.js:222:26)

Why does that happens?

DBGrid has a DataSource not a DataSet

May be the mistake is somewhere else, that is the reason why I share the whole procedure with you. Now, the buttons get the values, but the error is comming anyway.


procedure TForm_LogIn.CTimerTimer(Sender: TObject);
begin
   Inc(xSec);
   case xSec of
      50: begin
            CTimer.Enabled:=false;
            ShowMessage('Verbindungszeit ist abgelaufen!');
      end;
   end;
   if Data_Module.xConnection.Connected then begin
      //Design_LogIn;
      Data_Module.Get_Sprache;
      Label_LoginTitel.DataSource:=Data_Module.DSC_Sprache;
      Label_LoginTitel.DataField:='login_Titel';
      Label_LogInUser.DataSource:=Data_Module.DSC_Sprache;
      Label_LogInUser.DataField:='login_lable_username';
      Label_LogInPasswort.DataSource:=Data_Module.DSC_Sprache;
      Label_LogInPasswort.DataField:='login_label_passwort';
   btn_login_abbruch.Text:=Data_Module.xDST_Sprache.FieldByName('btn_login_abbruch').AsString;
      btn_login_ok.Text:=Data_Module.xDST_Sprache.FieldByName('btn_login_ok').AsString;
      CTimer.Enabled:=false;
   end;
end;

What do you mean by the buttons get the value?

I think this might be related with another support ticket I answered you: everything in web is asynchronous. Maybe the dataset is not ready yet (open) when you try to read data from it using FieldByName?