Beispiel #1
0
        /// <summary>
        /// predicate for open subforms
        /// </summary>
        /// <param name="ctrl"></param>
        /// <returns></returns>
        private bool IsSubformWithTask(MgControlBase ctrl)
        {
            bool isLoadTask = (ctrl.Type == MgControlType.CTRL_TYPE_SUBFORM &&
                               (SubformType)ctrl.getProp(PropInterface.PROP_TYPE_SUBFORM_TYPE).getValueInt() != SubformType.None);

            // QCR #177047. If the subform is visible or it's RefreshWhenHidden is 'Y' load the subform task.
            if (isLoadTask && !ctrl.isVisible() && !ctrl.checkProp(PropInterface.PROP_TYPE_REFRESH_WHEN_HIDDEN, false))
            {
                // QCR #282991.
                // It related to nested subforms. When the parent subform is invisible and it's RefreshWhenHidden = Y,
                // we load the parent subform. But the nested subform is loaded according its RefreshWhenHidden property.
                // If the nested subform has no visibility expression, so we load it together with its parent (RefreshWhenHidden property doesn't affect).
                // If the nested subform has a visibility expression, so we do not load this subform (RefreshWhenHidden = No).
                // In this case the subform is loaded when its control becomes visible or by SubformRefresh event.
                // QCR #315894. The subform may become visible also if it has such a parent control as a group control, a tab control, a combo box.
                Property visibleProperty = ctrl.getProp(PropInterface.PROP_TYPE_VISIBLE);
                if (ctrl.hasContainer() || ctrl.getLinkedParent(false) != null || visibleProperty.isExpression())
                {
                    isLoadTask = false;
                }
            }

            return(isLoadTask);
        }