getDPPicker method

dynamic getDPPicker(
  1. dynamic item,
  2. dynamic backcolor,
  3. dynamic context,
  4. dynamic formname,
  5. dynamic id,
  6. dynamic actions,
)

Implementation

getDPPicker(item, backcolor, context, formname, id, actions) {
  myLogAll('getDPPicker');
  var dpid = getDPidfromItem(item);
  bool isLabel = false;
  bool isIcon = false;
  if (item[gType] == gAddress) {
    isLabel = true;
  } else if (item[gType] == gIcon) {
    isIcon = true;
  }
  List sList = getDpListByKey(dpid, context, item[gValue]);
  int selectedIndex = -1;

  var value = getValue(
      _mFocusNode[gName], _mFocusNode[gCol], _mFocusNode[gId])[gValue];
  _dpListDefaultIndex[dpid] = -1;
  for (int i = 0; i < sList.length; i++) {
    selectedIndex = 0;
    _dpListDefaultIndex[dpid] = 0;
    if ((sList[i] is Map && sList[i][gLabel] == value) || sList[i] == value) {
      selectedIndex = i;
      _dpListDefaultIndex[dpid] = i;
      break;
    }
  }
  bool isSearch = false;
  if (isIcon) {
    isSearch = true;
  }
  Map param = {
    gAction: gLocalAction,
    gAction1: gDroplist,
    gHeight: null,
    gSelectedList: [selectedIndex],
    gData: [dpid],
    gWidth: [null],
    gFormName: formname,
    gId: id,
    gType: gDate,
    gIsLabel: isLabel,
    gIsIcon: isIcon,
    gSearch: isSearch
  };
  Widget result = MyListPicker(param, backcolor);

  return result;
}