Ejemplo n.º 1
0
        void ControlTreeDataLoader.LoadData()
        {
            if (TagKey == HtmlTextWriterTag.Button)
            {
                Attributes.Add("name", EwfPage.ButtonElementName);
                Attributes.Add("value", "v");
                Attributes.Add("type", usesSubmitBehavior ? "submit" : "button");
            }

            EwfPage.Instance.AddPostBack(postBack);

            if (ConfirmationWindowContentControl != null)
            {
                if (usesSubmitBehavior)
                {
                    throw new ApplicationException("PostBackButton cannot be the submit button and also have a confirmation message.");
                }
                confirmationWindow = new ModalWindow(ConfirmationWindowContentControl, title: "Confirmation", postBack: postBack);
            }
            else if (!usesSubmitBehavior)
            {
                PreRender += delegate { this.AddJavaScriptEventScript(JsWritingMethods.onclick, GetPostBackScript(postBack)); }
            }
            ;

            CssClass = CssClass.ConcatenateWithSpace("ewfClickable");
            ActionControlStyle.SetUpControl(this, "", width, height, setWidth);
        }
Ejemplo n.º 2
0
        void ControlTreeDataLoader.LoadData()
        {
            EwfPage.Instance.AddDisplayLink(this);

            // NOTE: Currently this hidden field will always be persisted in page state whether the page cares about that or not. We should put this decision into the
            // hands of the page, maybe by making ToggleButton sort of like a form control such that it takes a boolean value in its constructor and allows access to
            // its post back value.
            var controlsToggled = false;

            EwfHiddenField.Create(
                this,
                EwfPage.Instance.PageState.GetValue(this, pageStateKey, false).ToString(),
                postBackValue => controlsToggled = getControlsToggled(postBackValue),
                EwfPage.Instance.DataUpdate,
                out controlsToggledHiddenFieldValueGetter,
                out controlsToggledHiddenFieldClientIdGetter);
            EwfPage.Instance.DataUpdate.AddModificationMethod(
                () => AppRequestState.AddNonTransactionalModificationMethod(() => EwfPage.Instance.PageState.SetValue(this, pageStateKey, controlsToggled)));

            if (TagKey == HtmlTextWriterTag.Button)
            {
                PostBackButton.AddButtonAttributes(this);
            }
            this.AddJavaScriptEventScript(JsWritingMethods.onclick, handlerName + "()");
            CssClass    = CssClass.ConcatenateWithSpace("ewfClickable");
            textControl = ActionControlStyle.SetUpControl(this, "", width, height, w => base.Width = w);
        }
        void ControlTreeDataLoader.LoadData()
        {
            FormState.ExecuteWithDataModificationsAndDefaultAction(
                dataModifications,
                () => {
                if (TagKey == HtmlTextWriterTag.Button)
                {
                    Attributes.Add("name", EwfPage.ButtonElementName);
                    Attributes.Add("value", "v");
                    Attributes.Add("type", usesSubmitBehavior ? "submit" : "button");
                }

                FormAction action = postBackAction;
                action.AddToPageIfNecessary();

                if (ConfirmationWindowContentControl != null)
                {
                    if (usesSubmitBehavior)
                    {
                        throw new ApplicationException("PostBackButton cannot be the submit button and also have a confirmation message.");
                    }
                    confirmationWindow = new ModalWindow(this, ConfirmationWindowContentControl, title: "Confirmation", postBack: postBackAction.PostBack);
                }
                else if (!usesSubmitBehavior)
                {
                    PreRender += delegate { this.AddJavaScriptEventScript(JsWritingMethods.onclick, action.GetJsStatements() + " return false"); }
                }
                ;

                CssClass = CssClass.ConcatenateWithSpace("ewfClickable");
                ActionControlStyle.SetUpControl(this, "");
            });
        }
Ejemplo n.º 4
0
 void ControlTreeDataLoader.LoadData()
 {
     if (TagKey == HtmlTextWriterTag.Button)
     {
         PostBackButton.AddButtonAttributes(this);
     }
     CssClass = CssClass.ConcatenateWithSpace("ewfClickable");
     ActionControlStyle.SetUpControl(this, "", Unit.Empty, Unit.Empty, width => { });
 }
Ejemplo n.º 5
0
        /// <summary>
        /// Checks that WindowToLaunch has been set and applies the attributes for this LaunchWindowLink.
        /// </summary>
        void ControlTreeDataLoader.LoadData()
        {
            if (TagKey == HtmlTextWriterTag.Button)
            {
                PostBackButton.AddButtonAttributes(this);
            }
            CssClass = CssClass.ConcatenateWithSpace("ewfClickable");
            ActionControlStyle.SetUpControl(this, "");

            if (ToolTip != null || ToolTipControl != null)
            {
                new ToolTip(ToolTipControl ?? EnterpriseWebFramework.Controls.ToolTip.GetToolTipTextControl(ToolTip), this);
            }
        }
Ejemplo n.º 6
0
        void ControlTreeDataLoader.LoadData()
        {
            var url = "";

            if (destinationResourceInfo != null && !(destinationResourceInfo.AlternativeMode is DisabledResourceMode))
            {
                url = destinationResourceInfo.GetUrl();
                Attributes.Add("href", this.GetClientUrl(url));
            }

            if (isPostBackButton && url.Any())
            {
                var postBack = GetLinkPostBack(destinationResourceInfo);
                EwfPage.Instance.AddPostBack(postBack);
                PreRender += delegate { this.AddJavaScriptEventScript(JsWritingMethods.onclick, PostBackButton.GetPostBackScript(postBack)); };
            }
            if (navigatesInNewWindow)
            {
                Attributes.Add("target", "_blank");
            }
            if (popUpWindowSettings != null && url.Any())
            {
                this.AddJavaScriptEventScript(JsWritingMethods.onclick, JsWritingMethods.GetPopUpWindowScript(url, this, popUpWindowSettings) + " return false");
            }
            if (navigatesInOpeningWindow && (destinationResourceInfo == null || url.Any()))
            {
                var openingWindowNavigationScript = destinationResourceInfo != null ? "opener.document.location = '" + this.GetClientUrl(url) + "'; " : "";
                this.AddJavaScriptEventScript(JsWritingMethods.onclick, openingWindowNavigationScript + "window.close(); return false");
            }

            CssClass = CssClass.ConcatenateWithSpace("ewfClickable");
            if (destinationResourceInfo != null && destinationResourceInfo.AlternativeMode is NewContentResourceMode)
            {
                CssClass = CssClass.ConcatenateWithSpace(CssElementCreator.NewContentClass);
            }
            ActionControlStyle.SetUpControl(this, url, width, height, setWidth);

            if (destinationResourceInfo != null && destinationResourceInfo.AlternativeMode is DisabledResourceMode)
            {
                var message = (destinationResourceInfo.AlternativeMode as DisabledResourceMode).Message;
                new ToolTip(EnterpriseWebFramework.Controls.ToolTip.GetToolTipTextControl(message.Any() ? message : Translation.ThePageYouRequestedIsDisabled), this);
            }
            else if (toolTip != null || toolTipControl != null)
            {
                new ToolTip(toolTipControl ?? EnterpriseWebFramework.Controls.ToolTip.GetToolTipTextControl(toolTip), this);
            }
        }
Ejemplo n.º 7
0
        void ControlTreeDataLoader.LoadData()
        {
            Attributes.Add("href",
                           "mailto:" +
                           StringTools.ConcatenateWithDelimiter("?",
                                                                ToAddress,
                                                                StringTools.ConcatenateWithDelimiter("&",
                                                                                                     CcAddress.PrependDelimiter("cc="),
                                                                                                     BccAddress.PrependDelimiter("bcc="),
                                                                                                     HttpUtility.UrlEncode(Subject).PrependDelimiter("subject="),
                                                                                                     HttpUtility.UrlEncode(Body).PrependDelimiter("body="))));

            CssClass = CssClass.ConcatenateWithSpace("ewfClickable");
            ActionControlStyle.SetUpControl(this, "", width, height, setWidth);

            if (ToolTip != null || ToolTipControl != null)
            {
                new ToolTip(ToolTipControl ?? EnterpriseWebFramework.Controls.ToolTip.GetToolTipTextControl(ToolTip), this);
            }
        }
        void ControlTreeDataLoader.LoadData()
        {
            if (toolTipControl == null)
            {
                throw new ApplicationException("ToolTipControl must be set on ToolTipLink");
            }

            if (TagKey == HtmlTextWriterTag.Button)
            {
                PostBackButton.AddButtonAttributes(this);
            }

            // NOTE: When this control is rendered as an anchor, the presence of an onclick attribute is necessary for it to be selected properly by our action
            // control CSS elements. This hack would not be necessary if Telerik used the onclick attribute to open the tool tip.
            this.AddJavaScriptEventScript(JsWritingMethods.onclick, "");

            CssClass = CssClass.ConcatenateWithSpace("ewfClickable");
            ActionControlStyle.SetUpControl(this, "", Unit.Empty, Unit.Empty, width => { });

            new ToolTip(toolTipControl, this, title: ToolTipTitle ?? "", sticky: true);
        }