setValueFocus method

dynamic setValueFocus(
  1. dynamic actionData,
  2. dynamic context
)

Implementation

setValueFocus(actionData, context) {
  myLogAll('setValueFocus');
  /*var name = _mFocusNode[gName];
  var colId = mFocusNode[gCol];
  var id =_mFocusNode[gId];
  setFocusNext(name, colId, id, true, context);*/

  myLog('setValueFocus:$actionData');
  String label = actionData[gLabel].toString();
  if (isNull(label)) {
    if (!isNull(actionData[gValue])) {
      label = actionData[gValue];
    }
  }
  if (isNull(label)) {
    return;
  }
  label = getValueLabel(label, gBackContext); //tip click to main page

  if (!isNull(actionData[gValue]) && actionData[gValue] == gBackContext) {
    backContext(actionData, context);
    thirdAfterBackContext(this, actionData, context);
    return;
  }
  myLog('setValueFocus:getValueCurrent');
  dynamic value = getValueCurrent()[gValue];
  if (!isNull(actionData[gInputType]) && actionData[gInputType] == gMoney) {
    value = fromMoney(value);
  }
  if (actionData[gAddnew] == gAppend) {
    if (_numberSet.contains(label)) {
      value = '$value$label';
    } else if (label == gBackspace) {
      if (!isNull(value)) {
        value = value.toString().substring(0, value.toString().length - 1);
      }
    } else if (label == gCancel) {
      value = '';
    }
  } else {
    value = label;

    /*if (actionData[gAddnew] == gBackContext) {
      backContext(actionData, context);
      thirdAfterBackContext(this, actionData, context);
    }*/
  }
  value = getValueGUI(value, actionData);
  myLog('setValueFocus:setValueCurrent');
  setValueCurrent(value, context);
  myNotifyListeners();
  if (!isNull(actionData[gAddnew])) {
    if (actionData[gAddnew] == gBackContext) {
      backContext(actionData, context);
    }
    thirdAfterBackContext(this, actionData, context);
  }
}