TDBLabel (and TDBEdit) first update OK, but not next

I'm using locial chain to display content from xData (Aurelius) to DBLabel

  1. XDataWebConnection
  2. XDataWebDataSet = XDataWebDataSet_Detail
  3. WebDataSource = WebDataSource_Detail
  4. WebDBLabel bind to "nom" field from xData

To adapt content of DBLabel to context I'm using string temp_name to retrieve value

XDataWebDataSet_Detail.QueryString := '$filter=nom eq '''+temp_name+'''';

First call, displays the right selected value in WebDBLabel (OK)
If I change the context with temp_name value, browser debug network shows there is a call to xData server retrieving the right JSON but update of WebDBLabel isn't no more applied and stays with previous value.
(same with a WebDBEdit)

Not sure if it's due to a missing action forcing to refresh display value, but I doubt as if I set a string = "--" in WebDBLabel before calling XDataWebDataSet query+load, first value is well displayed not the second and next.

WebDBLabel1.Caption := '--';
ShowMessage('Nom = '+temp_name);
XDataWebDataSet_Detail.QueryString := '$filter=nom eq '''+temp_name+'''';

Please do you get an idea about way to fix or to investigate?


I fixed the problem by inactivating the XDataWebDataSet before processing filter+load

XDataWebDataSet_Detail.Active := False;
XDataWebDataSet_Detail.QueryString := '$filter=nom eq '''+temp_name+'''';

2 options

  • if it's normal behavior, please update xData doc about " Loading data automatically"
  • if it's abnormal, probably an background exception occurs preventing refresh with an active XDataWebDataSet

This is by design. The documentation already says that Open is called after calling Load, but we will stress that for data to be updated you need to close the dataset.

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.