Ejemplo n.º 1
0
        protected override async Task NavigateToFabLink()
        {
            if (IsTapped || EbPageHelper.IsShortTap())
            {
                return;
            }
            IsTapped = true;
            Loader msgLoader = EbLayout.GetMessageLoader();

            msgLoader.IsVisible = true;
            msgLoader.Message   = "Loading...";
            string linkRefID = Visualization.UseLinkSettings ? Visualization.LinkRefId : Visualization.FabLinkRefId;

            EbMobilePage page = EbPageHelper.GetPage(linkRefID);

            if (page != null && page.Container is EbMobileForm form)
            {
                form.NetworkType = page.NetworkMode;
                string failMsg = await EbPageHelper.ValidateFormRendering(form, msgLoader, this.ContextRecord);

                if (failMsg == null)
                {
                    await App.Navigation.NavigateMasterAsync(new FormRender(page, Visualization, ContextRecord));
                }
                else
                {
                    await App.Navigation.NavigateMasterAsync(new Redirect(failMsg));
                }
            }
            msgLoader.IsVisible = false;
            IsTapped            = false;
        }
Ejemplo n.º 2
0
        public async void InitNavigation()
        {
            EbMobileSettings settings = App.Settings.CurrentApplication?.AppSettings;

            IMasterPage master;

            if (settings != null && !string.IsNullOrEmpty(settings.DashBoardRefId))
            {
                EbMobilePage page = EbPageHelper.GetPage(settings.DashBoardRefId);

                if (page != null && page.Container is EbMobileDashBoard)
                {
                    master = new DashBoardRender(page);
                }
                else
                {
                    EbLog.Info("Default application dashboard not found, check object permissions");
                    master = new Home();
                }
            }
            else
            {
                master = new Home();
            }

            master.UpdateMasterLayout();

            await Detail.Navigation.PushAsync((Page)master);
        }
        public static EbMobileForm ResolveDependency(this EbMobileForm sourceForm)
        {
            try
            {
                EbMobilePage autogenvis = EbPageHelper.GetPage(sourceForm.AutoGenMVRefid);

                if (autogenvis != null)
                {
                    string linkref = (autogenvis.Container as EbMobileVisualization).LinkRefId;

                    if (!string.IsNullOrEmpty(linkref))
                    {
                        EbMobilePage linkpage = EbPageHelper.GetPage(linkref);

                        if (linkpage != null && linkpage.Container is EbMobileVisualization viz)
                        {
                            EbMobilePage innerlink = EbPageHelper.GetPage(viz.LinkRefId);

                            if (innerlink != null && innerlink.Container is EbMobileForm mf)
                            {
                                return(mf);
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                EbLog.Info("Failed to resolve form dependencies");
                EbLog.Error(ex.Message);
            }
            return(null);
        }
Ejemplo n.º 4
0
        public async virtual Task OnControlAction(EbDataRow row)
        {
            if (string.IsNullOrEmpty(this.LinkRefId))
            {
                return;
            }

            EbMobilePage page = EbPageHelper.GetPage(this.LinkRefId) ?? EbPageHelper.GetExternalPage(this.LinkRefId);

            if (page != null)
            {
                EbMobileContainer container = page.Container;

                if (container is EbMobileForm)
                {
                    if (this.FormMode == WebFormDVModes.New_Mode)
                    {
                        await App.Navigation.NavigateMasterAsync(new FormRender(page, this.LinkFormParameters, row));
                    }
                    else
                    {
                        try
                        {
                            var map = this.FormId;
                            if (map == null)
                            {
                                EbLog.Info("form id should be set");
                                throw new Exception("Form rendering exited! due to null value for 'FormId'");
                            }
                            else
                            {
                                int id = Convert.ToInt32(row[map.ColumnName]);
                                if (id <= 0)
                                {
                                    EbLog.Info("id has ivalid value" + id);
                                    throw new Exception("Form rendering exited! due to invalid id");
                                }
                                await App.Navigation.NavigateMasterAsync(new FormRender(page, id));
                            }
                        }
                        catch (Exception ex)
                        {
                            EbLog.Error(ex.Message);
                        }
                    }
                }
                else if (container is EbMobileVisualization)
                {
                    await App.Navigation.NavigateMasterAsync(new ListRender(page, row));
                }
            }
        }
Ejemplo n.º 5
0
        private async Task EditButtonClicked()
        {
            EbMobilePage page = EbPageHelper.GetPage(Context.SourceFormRefId);

            if (page != null)
            {
                int id = Convert.ToInt32(ContextRecord["id"]);
                if (id != 0)
                {
                    FormRender Renderer = new FormRender(page, id);
                    await App.Navigation.NavigateMasterAsync(Renderer);
                }
            }
        }
        private async Task ResolveRedirection(EbNFLink link)
        {
            if (string.IsNullOrEmpty(link.LinkRefId))
            {
                EbLog.Info("Intentaction link type is page but linkrefid null");
                return;
            }
            EbMobilePage page = EbPageHelper.GetPage(link.LinkRefId);

            if (page != null)
            {
                EbLog.Info("Intentaction page rendering :" + page.DisplayName);

                ContentPage renderer = EbPageHelper.GetPageByContainer(page);
                await App.Navigation.NavigateMasterAsync(renderer);
            }
            else
            {
                EbLog.Info("Intentaction page not found for linkrefid:" + link.LinkRefId);
            }
        }
        private async void OnClick(object sender, EventArgs e)
        {
            if (isTapped)
            {
                return;
            }

            try
            {
                isTapped = true;

                EbMobilePage page = EbPageHelper.GetPage(LinkRefId);

                if (page != null)
                {
                    EbPageRenderer renderer = await EbPageHelper.GetRenderer(page);

                    if (renderer.IsReady)
                    {
                        EbLog.Info(renderer.Message);
                        await App.Navigation.NavigateMasterAsync(renderer.Renderer);
                    }
                    else
                    {
                        EbLog.Error("unable to create renderer, [DataLink] " + renderer.Message);
                    }
                }
                else
                {
                    EbLog.Warning("page not found in [DataLink], Check permission");
                }
            }
            catch (Exception ex)
            {
                EbLog.Info("[EbMobileDashboard] click navigation error");
                EbLog.Error(ex.Message);
            }

            isTapped = false;
        }