コード例 #1
0
 protected override void loadData()
 {
     pb = PostBack.CreateFull();
     ph.AddControlsReturnThis(
         FormItemBlock.CreateFormItemTable( heading: "Radio Button List, Vertical", formItems: getRadioItems( false ) ),
         FormItemBlock.CreateFormItemTable( heading: "Radio Button List, Horizontal", formItems: getRadioItems( true ) ),
         getSelect2UpgradeTestingInfo(),
         FormItemBlock.CreateFormItemTable( heading: "Drop-Down List", formItems: getDropDownItems() ) );
     EwfUiStatics.SetContentFootActions( new ActionButtonSetup( "Submit", new PostBackButton( pb ) ) );
 }
コード例 #2
0
        /// <summary>
        /// Creates a page content object that uses the EWF user interface.
        /// </summary>
        /// <param name="omitContentBox">Pass true to omit the box-style effect around the page content. Useful when all content is contained within multiple
        /// box-style sections.</param>
        /// <param name="pageActions">The page actions.</param>
        /// <param name="contentFootActions">The content-foot actions. The first action, if it is a post-back, will produce a submit button.</param>
        /// <param name="contentFootComponents">The content-foot components.</param>
        /// <param name="dataUpdateModificationMethod">The modification method for the page’s data-update modification.</param>
        /// <param name="isAutoDataUpdater">Pass true to force a post-back when a hyperlink is clicked.</param>
        /// <param name="pageLoadPostBack">A post-back that will be triggered automatically by the browser when the page is finished loading.</param>
        public UiPageContent(
            bool omitContentBox = false, IReadOnlyCollection <ActionComponentSetup> pageActions = null, IReadOnlyCollection <ButtonSetup> contentFootActions = null,
            IReadOnlyCollection <FlowComponent> contentFootComponents = null, Action dataUpdateModificationMethod = null, bool isAutoDataUpdater             = false,
            ActionPostBack pageLoadPostBack = null)
        {
            pageActions = pageActions ?? Enumerable.Empty <ActionComponentSetup>().Materialize();
            if (contentFootActions != null && contentFootComponents != null)
            {
                throw new ApplicationException("Either contentFootActions or contentFootComponents may be specified, but not both.");
            }
            if (contentFootActions == null && contentFootComponents == null)
            {
                contentFootActions = Enumerable.Empty <ButtonSetup>().Materialize();
            }

            entityUiSetup = (PageBase.Current.EsAsBaseType as UiEntitySetup)?.GetUiSetup();
            basicContent  =
                new BasicPageContent(
                    dataUpdateModificationMethod: dataUpdateModificationMethod,
                    isAutoDataUpdater: isAutoDataUpdater,
                    pageLoadPostBack: pageLoadPostBack).Add(
                    getGlobalContainer()
                    .Append(
                        new GenericFlowContainer(
                            getEntityAndTopTabContainer()
                            .Append(
                                EwfTable.Create(style: EwfTableStyle.Raw, classes: sideTabAndContentBlockClass)
                                .AddItem(
                                    EwfTableItem.Create(
                                        (entityUsesTabMode(TabMode.Vertical)
                                                                                                                  ? getSideTabContainer().ToCell(setup: new TableCellSetup(classes: sideTabContainerClass)).ToCollection()
                                                                                                                  : Enumerable.Empty <EwfTableCell>()).Append(
                                            getPageActionListContainer(pageActions)
                                            .Append(
                                                new DisplayableElement(
                                                    context => new DisplayableElementData(
                                                        null,
                                                        () => new DisplayableElementLocalData("div"),
                                                        classes: omitContentBox ? null : contentClass,
                                                        children: content)))
                                            .Concat(getContentFootBlock(isAutoDataUpdater, contentFootActions, contentFootComponents))
                                            .Materialize()
                                            .ToCell(setup: new TableCellSetup(classes: contentClass)))
                                        .Materialize())))
                            .Materialize(),
                            clientSideIdOverride: entityAndTabAndContentBlockId))
                    .Concat(getGlobalFootContainer())
                    .Materialize());

            if (!EwfUiStatics.AppProvider.BrowserWarningDisabled() && AppRequestState.Instance.Browser.IsOldVersionOfMajorBrowser())
            {
                PageBase.AddStatusMessage(
                    StatusMessageType.Warning,
                    StringTools.ConcatenateWithDelimiter(
                        " ",
                        "We've detected that you are not using the latest version of your browser.",
                        "While most features of this site will work, and you will be safe browsing here, we strongly recommend using the newest version of your browser in order to provide a better experience on this site and a safer experience throughout the Internet.") +
                    "<br/>" +
                    Tewl.Tools.NetTools.BuildBasicLink("Click here to get Firefox (it's free)", new ExternalResource("http://www.getfirefox.com").GetUrl(), true) +
                    "<br />" +
                    Tewl.Tools.NetTools.BuildBasicLink(
                        "Click here to get Chrome (it's free)",
                        new ExternalResource("https://www.google.com/intl/en/chrome/browser/").GetUrl(),
                        true) + "<br />" + Tewl.Tools.NetTools.BuildBasicLink(
                        "Click here to get the latest Internet Explorer (it's free)",
                        new ExternalResource("http://www.beautyoftheweb.com/").GetUrl(),
                        true));
            }
        }