Exemplo n.º 1
0
        private QAT BuildQATInternal(object data, QATBuildContext qbc)
        {
            if (CUIUtility.IsNullOrUndefined(data))
            {
                throw new ArgumentNullException("No QAT element was present in the data");
            }

            QAT = new QAT(DataNodeWrapper.GetAttribute(data, "Id"),
                          DataNodeWrapper.GetNodeAttributes(data).To <QATProperties>());

            // Handle the controls in the QAT
            // The XML structure looks like <QAT><Controls><Control></Control><Control></Control>...
            JSObject controlsParent = DataNodeWrapper.GetFirstChildNodeWithName(data, DataNodeWrapper.CONTROLS);

            JSObject[] controls = DataNodeWrapper.GetNodeChildren(controlsParent);
            for (int j = 0; j < controls.Length; j++)
            {
                if (!IsNodeTrimmed(controls[j]))
                {
                    Control control = BuildControl(controls[j], qbc);
                    QAT.AddChild(control.CreateComponentForDisplayMode("Small"));
                }
            }

            return(QAT);
        }
Exemplo n.º 2
0
        private void OnReturnQAT(DataQueryResult dqr)
        {
            QATBuildContext qbc = (QATBuildContext)dqr.ContextData;

            // Apply any extensions to the data.
            dqr.QueryData = ApplyDataExtensions(dqr.QueryData);

            QAT            = BuildQATInternal(DataNodeWrapper.GetFirstChildNodeWithName(dqr.QueryData, DataNodeWrapper.QAT), qbc);
            QAT.QATBuilder = this;
            BuildClient.OnComponentCreated(QAT, QAT.Id);

            if (QATBuildOptions.AttachToDOM)
            {
                QAT.AttachInternal(true);
            }
            else
            {
                QAT.RefreshInternal();
                Placeholder.AppendChild(QAT.ElementInternal);
                Utility.EnsureCSSClassOnElement(Placeholder, "loaded");
            }
            OnRootBuilt(QAT);
            BuildClient.OnComponentBuilt(QAT, QAT.Id);
        }
Exemplo n.º 3
0
        private void OnReturnQAT(DataQueryResult dqr)
        {
            QATBuildContext qbc = (QATBuildContext)dqr.ContextData;

            // Apply any extensions to the data.
            dqr.QueryData = ApplyDataExtensions(dqr.QueryData);

            QAT = BuildQATInternal(DataNodeWrapper.GetFirstChildNodeWithName(dqr.QueryData, DataNodeWrapper.QAT), qbc);
            QAT.QATBuilder = this;
            BuildClient.OnComponentCreated(QAT, QAT.Id);

            if (QATBuildOptions.AttachToDOM)
            {
                QAT.AttachInternal(true);
            }
            else
            {
                QAT.RefreshInternal();
                Placeholder.AppendChild(QAT.ElementInternal);
                Utility.EnsureCSSClassOnElement(Placeholder, "loaded");
            }
            OnRootBuilt(QAT);
            BuildClient.OnComponentBuilt(QAT, QAT.Id);
        }
Exemplo n.º 4
0
        private QAT BuildQATInternal(object data, QATBuildContext qbc)
        {
            if (CUIUtility.IsNullOrUndefined(data))
                throw new ArgumentNullException("No QAT element was present in the data");

            QAT = new QAT(DataNodeWrapper.GetAttribute(data, "Id"),
                          DataNodeWrapper.GetNodeAttributes(data).To<QATProperties>());

            // Handle the controls in the QAT
            // The XML structure looks like <QAT><Controls><Control></Control><Control></Control>...
            JSObject controlsParent = DataNodeWrapper.GetFirstChildNodeWithName(data, DataNodeWrapper.CONTROLS);
            JSObject[] controls = DataNodeWrapper.GetNodeChildren(controlsParent);
            for (int j = 0; j < controls.Length; j++)
            {
                if (!IsNodeTrimmed(controls[j]))
                {
                    Control control = BuildControl(controls[j], qbc);
                    QAT.AddChild(control.CreateComponentForDisplayMode("Small"));
                }
            }

            return QAT;
        }