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, "");
            });
        }
Exemplo n.º 2
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(this, 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);
        }
        // GMS NOTE: Why would we have a constructor that doesn't take a control style if it seems to be absolutely required?
        /// <summary>
        /// Creates a new LaunchWindowLink with the given ModalWindow to launch when clicked.
        /// You must set the ActionControlStyle after creating this object.
        /// </summary>
        public LaunchWindowLink( ModalWindow windowToLaunch )
        {
            ActionControlStyle = new TextActionControlStyle( "" );

            if( windowToLaunch == null )
                throw new ApplicationException( "WindowToLaunch must be set on LaunchWindowLink" );
            this.windowToLaunch = windowToLaunch;
        }
Exemplo n.º 4
0
        // GMS NOTE: Why would we have a constructor that doesn't take a control style if it seems to be absolutely required?
        /// <summary>
        /// Creates a new LaunchWindowLink with the given ModalWindow to launch when clicked.
        /// You must set the ActionControlStyle after creating this object.
        /// </summary>
        public LaunchWindowLink(ModalWindow windowToLaunch)
        {
            ActionControlStyle = new TextActionControlStyle("");

            if (windowToLaunch == null)
            {
                throw new ApplicationException("WindowToLaunch must be set on LaunchWindowLink");
            }
            this.windowToLaunch = windowToLaunch;
        }
        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( this, 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 );
        }
        void EntitySetupBase.LoadData()
        {
            ph.AddControlsReturnThis(
                new Paragraph( "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed quis semper dui. Aenean egestas dolor ac elementum lacinia. Vestibulum eget." ) );

            one = new ModalWindow( this, new Paragraph( "Test!" ) );
            two = new ModalWindow(
                this,
                new EwfImage( new ExternalResourceInfo( "http://i3.microsoft.com/en/shared/templates/components/cspMscomHeader/m_head_blend.png" ) ) );
        }