Current filter:
                                You should refresh the page.
                                  • I have a popup action where are 2 BO with relation 1:1. (zlecenie A: badanie B)
                                    1 .if  B not exist then i want to show popup window, get selected record, next add B record and show detail view for B.
                                    2. If B exist i want display detail View for B without showing popup window like in 1 case.

                                    Below is my code, but there is a one problem in scenario 1 detail View display as normal docked window, but in scenario 2, this window show as popup.

                                    How to display detail view for B in scenario 2 as normal (not popup) window ?
                                    I think it can be one that popup windo is showed only if B record not exists, but execute event is fired in both cases. How to prevent showing popup window in scenario 2 ?

                                    [C#]
                                    private void OpiszMaterialAction_CustomizePopupWindowParams(object sender, CustomizePopupWindowParamsEventArgs e) { objectSpaceBadania = Application.CreateObjectSpace(); zlecenie = objectSpaceBadania.GetObject((ZlecenieBadania)View.CurrentObject); // e.View = Application.CreateDetailView(Application.CreateObjectSpace(), new WybierzRodzajBadania()); var badanie = objectSpaceBadania.FindObject<BadaniePatomorfologiczne>(CriteriaOperator.Parse("ZlecenieBadania = ?", zlecenie)); if (badanie == null) { IObjectSpace objectSpace = Application.CreateObjectSpace(typeof(RodzajBadania)); string markeryListviewId = Application.FindLookupListViewId(typeof(RodzajBadania)); CollectionSourceBase collectionSource = Application.CreateCollectionSource(objectSpace, typeof(RodzajBadania), markeryListviewId); e.View = Application.CreateListView(markeryListviewId, collectionSource, true); ////Optionally customize the window display settings. e.Size = new System.Drawing.Size(600, 400); e.Maximized = false; e.IsSizeable = false; } else { string detailId = Application.FindDetailViewId(typeof(BadaniePatomorfologiczne)); DetailView detailView = Application.CreateDetailView(objectSpaceBadania, detailId, true, badanie); e.View = detailView; e.Maximized = true; e.IsSizeable = false; } } private void OpiszMaterialAction_Execute(object sender, PopupWindowShowActionExecuteEventArgs e) { var badanie = objectSpaceBadania.FindObject<BadaniePatomorfologiczne>(CriteriaOperator.Parse("ZlecenieBadania = ?", zlecenie)); if (badanie == null) { var selectedRec = objectSpaceBadania.GetObject((RodzajBadania)e.PopupWindowViewSelectedObjects[0]); badanie = objectSpaceBadania.CreateObject<BadaniePatomorfologiczne>(); badanie.ZlecenieBadania = zlecenie; badanie.Pacjent = zlecenie.Pacjent; badanie.RodzajBadania = selectedRec; } zlecenie.Badanie = badanie; string detailId = Application.FindDetailViewId(typeof(BadaniePatomorfologiczne)); DetailView detailView = Application.CreateDetailView(objectSpaceBadania, detailId, true, badanie); e.ShowViewParameters.CreatedView = detailView; e.ShowViewParameters.Context = TemplateContext.View; e.ShowViewParameters.TargetWindow = TargetWindow.NewWindow; detailView.Closed += View_Closed; } private void View_Closed(object sender, EventArgs e) { View.ObjectSpace.Refresh(); }

                                1 Solution

                                Creation Date Importance Sort by

                                Hello Jacek,

                                To implement this, use SimpleAction instead of PopupWindowShowAction. Specify the View that you want to show in the e.ShowViewParameters.CreatedView property, and the target window in the e.ShowViewParameters.TargetWindow property. See Ways to Show a View for details.
                                To process objects selected in the popup window, use Dialog Controller.

                                • Jacek Kosiński 10.09.2019

                                  Thanks for reply.

                                  i prepare popup window with simple action ... but there one problem
                                  there no search action . is any way to show search entry with searching action like on normal list view ?

                                  [C#]
                                  private void TemplateSimpleAction_Execute(object sender, DevExpress.ExpressApp.Actions.SimpleActionExecuteEventArgs e) { IObjectSpace objectSpace = Application.CreateObjectSpace(typeof(SkrotyMedyczne)); string listViewId = Application.FindListViewId(typeof(SkrotyMedyczne)); e.ShowViewParameters.CreatedView = Application.CreateListView( listViewId, Application.CreateCollectionSource(objectSpace, typeof(SkrotyMedyczne), listViewId), true); // e.ShowViewParameters.TargetWindow = TargetWindow.NewWindow; e.ShowViewParameters.TargetWindow = TargetWindow.NewModalWindow; e.ShowViewParameters.Context = TemplateContext.PopupWindow; e.ShowViewParameters.CreateAllControllers = true; var dc = Application.CreateController<DialogController>(); dc.Accepting += accepting; dc.Cancelling += cancelling; e.ShowViewParameters.Controllers.Add(dc); } private void cancelling(object sender, EventArgs e) { } private void accepting(object sender, DialogControllerAcceptingEventArgs e) { if (currentDocServer != null) { foreach (SkrotyMedyczne item in e.AcceptActionArgs.SelectedObjects) { //... } } }
                                • Jacek Kosiński 10.10.2019

                                  I try use search panel, but there i have extra press search button - it is not optimized for fast searching
                                  i've realized that the best option will be Find entry field as exist in lookup list. Is possible to add it  to popup window?

                                • Gosha (DevExpress Support) 10.10.2019

                                  Hello Jacek,

                                  I've created a separate ticket on your behalf (T822495: How to show the Search action on a List View in a popup window). It has been placed in our processing queue and will be answered shortly.

                                • Jacek Kosiński 10.15.2019

                                  I try use simple action to open popup window, but i find next disadvantage of ths method:

                                  when i open popup window with list view with popup action in list view is visible New button , but if it's open by simple action these buttons are not visible. How to force show new button in popup listview called by simple action ?

                                  [C#]
                                  public ShowPopupController() { PopupWindowShowAction showPopupAction = new PopupWindowShowAction( this, "ShowPopup", DevExpress.Persistent.Base.PredefinedCategory.View ); showPopupAction.CustomizePopupWindowParams += this.showPopupAction_CustomizePopupWindowParams; SimpleAction simpleAction = new SimpleAction( this, "show popup simple action", DevExpress.Persistent.Base.PredefinedCategory.View); simpleAction.Execute += execute_simpleAction; } private void execute_simpleAction(object sender, SimpleActionExecuteEventArgs e) { e.ShowViewParameters.CreatedView = Application.CreateListView(Application.CreateObjectSpace(), typeof(Person), false); e.ShowViewParameters.TargetWindow = TargetWindow.NewModalWindow; e.ShowViewParameters.Context = TemplateContext.PopupWindowContextName; e.ShowViewParameters.CreateAllControllers = true; } private void showPopupAction_CustomizePopupWindowParams(object sender, CustomizePopupWindowParamsEventArgs e) { e.View = Application.CreateListView(e.Application.CreateObjectSpace(), typeof(Person), false); }
                                • Gosha (DevExpress Support) 10.15.2019

                                  Hello,

                                  I've created a separate ticket on your behalf (T823722: The New action is not available on the Popup List View invoked from a Simple action). It has been placed in our processing queue and will be answered shortly.