@xuda.io/runtime-bundle 1.0.521 → 1.0.523

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5326,7 +5326,7 @@ func.datasource.update = async function (SESSION_ID, datasource_changes, update_
5326
5326
  let client_datasource_changes = {};
5327
5327
  let server_datasource_changes = {};
5328
5328
 
5329
- const update_xu_ref = function (dataSource, field_id) {
5329
+ const update_xu_ref = function (dataSource) {
5330
5330
  let ret;
5331
5331
  let _ds_0 = _session.DS_GLB[0];
5332
5332
  for ([ref_name, val] of Object.entries(_ds_0.data_system['SYS_GLOBAL_OBJ_REFS'])) {
@@ -5351,7 +5351,7 @@ func.datasource.update = async function (SESSION_ID, datasource_changes, update_
5351
5351
  // mechanism to make update directly on the datasource object
5352
5352
  if (record_id === 'datasource_main') {
5353
5353
  _.set(_ds, field_id, value);
5354
- const ret = update_xu_ref(dataSource, field_id);
5354
+ const ret = update_xu_ref(dataSource);
5355
5355
  if (ret) {
5356
5356
  fields_changed.push(field_id);
5357
5357
  datasource_changed.push(dataSource);
@@ -5372,7 +5372,7 @@ func.datasource.update = async function (SESSION_ID, datasource_changes, update_
5372
5372
  await set_fieldComputed_dependencies(dataSource, field_id, null);
5373
5373
 
5374
5374
  // search the field in refs
5375
- update_xu_ref(dataSource, field_id);
5375
+ update_xu_ref(dataSource);
5376
5376
 
5377
5377
  if (!update_local_scope_only) {
5378
5378
  let tree_ret = await func.utils.TREE_OBJ.get(SESSION_ID, _ds.prog_id);
@@ -12389,12 +12389,19 @@ func.UI.screen.refresh_screen = async function (SESSION_ID, fields_changed_arr,
12389
12389
 
12390
12390
  try {
12391
12391
  // const panelDivData = panel_val.$panel_div.data().xuPanelWrapper.panelDivData;
12392
-
12392
+ const ts = Date.now();
12393
12393
  // remove old panel content
12394
12394
  $.each(panel_val.ids, async function (key, val) {
12395
- $("[xu-ui-id='" + val + "']").remove();
12395
+ $("[xu-ui-id='" + val + "']").attr('xu-ui-id', val + ts);
12396
12396
  });
12397
12397
 
12398
+ let refreshed_ds;
12399
+ // check if ds exist and deleted by garbage collector
12400
+ const _session = SESSION_OBJ[SESSION_ID];
12401
+ if (_session.DS_GLB[panel_val._ds.dsSession]) {
12402
+ refreshed_ds = panel_val._ds.dsSession;
12403
+ }
12404
+
12398
12405
  const new_$div = await func.UI.screen.render_ui_tree(
12399
12406
  SESSION_ID,
12400
12407
  $div_elm, // the wrapper
@@ -12404,11 +12411,16 @@ func.UI.screen.refresh_screen = async function (SESSION_ID, fields_changed_arr,
12404
12411
  null,
12405
12412
  null,
12406
12413
  wrapper_data.xuData.key, // the wrapper key
12407
- panel_val._ds.dsSession, // the refreshed_ds
12414
+ refreshed_ds, // the refreshed_ds
12408
12415
  wrapper_data.xuData.parent_node, // the wrapper parent node
12409
12416
  null,
12410
12417
  wrapper_data.xuData.$root_container, // the wrapper root container
12411
12418
  );
12419
+
12420
+ // remove old panel content
12421
+ $.each(panel_val.ids, async function (key, val) {
12422
+ $("[xu-ui-id='" + val + ts + "']").remove();
12423
+ });
12412
12424
  } catch (error) {
12413
12425
  debugger;
12414
12426
  }
@@ -5327,7 +5327,7 @@ func.datasource.update = async function (SESSION_ID, datasource_changes, update_
5327
5327
  let client_datasource_changes = {};
5328
5328
  let server_datasource_changes = {};
5329
5329
 
5330
- const update_xu_ref = function (dataSource, field_id) {
5330
+ const update_xu_ref = function (dataSource) {
5331
5331
  let ret;
5332
5332
  let _ds_0 = _session.DS_GLB[0];
5333
5333
  for ([ref_name, val] of Object.entries(_ds_0.data_system['SYS_GLOBAL_OBJ_REFS'])) {
@@ -5352,7 +5352,7 @@ func.datasource.update = async function (SESSION_ID, datasource_changes, update_
5352
5352
  // mechanism to make update directly on the datasource object
5353
5353
  if (record_id === 'datasource_main') {
5354
5354
  _.set(_ds, field_id, value);
5355
- const ret = update_xu_ref(dataSource, field_id);
5355
+ const ret = update_xu_ref(dataSource);
5356
5356
  if (ret) {
5357
5357
  fields_changed.push(field_id);
5358
5358
  datasource_changed.push(dataSource);
@@ -5373,7 +5373,7 @@ func.datasource.update = async function (SESSION_ID, datasource_changes, update_
5373
5373
  await set_fieldComputed_dependencies(dataSource, field_id, null);
5374
5374
 
5375
5375
  // search the field in refs
5376
- update_xu_ref(dataSource, field_id);
5376
+ update_xu_ref(dataSource);
5377
5377
 
5378
5378
  if (!update_local_scope_only) {
5379
5379
  let tree_ret = await func.utils.TREE_OBJ.get(SESSION_ID, _ds.prog_id);
@@ -10121,12 +10121,19 @@ func.UI.screen.refresh_screen = async function (SESSION_ID, fields_changed_arr,
10121
10121
 
10122
10122
  try {
10123
10123
  // const panelDivData = panel_val.$panel_div.data().xuPanelWrapper.panelDivData;
10124
-
10124
+ const ts = Date.now();
10125
10125
  // remove old panel content
10126
10126
  $.each(panel_val.ids, async function (key, val) {
10127
- $("[xu-ui-id='" + val + "']").remove();
10127
+ $("[xu-ui-id='" + val + "']").attr('xu-ui-id', val + ts);
10128
10128
  });
10129
10129
 
10130
+ let refreshed_ds;
10131
+ // check if ds exist and deleted by garbage collector
10132
+ const _session = SESSION_OBJ[SESSION_ID];
10133
+ if (_session.DS_GLB[panel_val._ds.dsSession]) {
10134
+ refreshed_ds = panel_val._ds.dsSession;
10135
+ }
10136
+
10130
10137
  const new_$div = await func.UI.screen.render_ui_tree(
10131
10138
  SESSION_ID,
10132
10139
  $div_elm, // the wrapper
@@ -10136,11 +10143,16 @@ func.UI.screen.refresh_screen = async function (SESSION_ID, fields_changed_arr,
10136
10143
  null,
10137
10144
  null,
10138
10145
  wrapper_data.xuData.key, // the wrapper key
10139
- panel_val._ds.dsSession, // the refreshed_ds
10146
+ refreshed_ds, // the refreshed_ds
10140
10147
  wrapper_data.xuData.parent_node, // the wrapper parent node
10141
10148
  null,
10142
10149
  wrapper_data.xuData.$root_container, // the wrapper root container
10143
10150
  );
10151
+
10152
+ // remove old panel content
10153
+ $.each(panel_val.ids, async function (key, val) {
10154
+ $("[xu-ui-id='" + val + ts + "']").remove();
10155
+ });
10144
10156
  } catch (error) {
10145
10157
  debugger;
10146
10158
  }