Forums

xaf view from a custom window

Last post 2/20/2010 4:04 AM by johns johns. 13 replies.
Sort Posts: Previous Next
  • xd yang

    xaf view from a custom window

    1/30/2010 12:42 PM
    • Top 500 Contributor
    • Joined on 11/20/2008
    • Posts 41

    I saw the post

    http://devexpress.com/Support/Center/p/Q235358.aspx

     

    How to invoke a xaf view from a custom window, it seems that XAF doesn't support a lookup dialog from custom window.

    how about a detailview item?

    1/  show  detail view as popup dialog

    2/ for (1), it must have a URL. I show the url from other cusom page...  ( I tried, sometimes session lost...)

     

    is it possible?

     

  • Gary L Cox Jr [DX-Squad]

    Re: xaf view from a custom window

    1/30/2010 6:15 PM
    • Top 50 Contributor
    • Joined on 9/9/2007
    • Austin, Tx
    • Posts 811
  • xd yang

    Re: xaf view from a custom window

    1/31/2010 5:03 AM
    • Top 500 Contributor
    • Joined on 11/20/2008
    • Posts 41

    it is different. E911 is to show custom window from XAF, while this one is trying to show xaf detailview item from the custom window.

  • xd yang

    Re: xaf view from a custom window

    1/31/2010 9:41 AM
    • Top 500 Contributor
    • Joined on 11/20/2008
    • Posts 41

    to  make it short,

    I show a webcontrol (custom form) in xaf using the methond in E911, --StandardEmbeddedFormWithCustomControl---

     

    in this form, I have a button click and want to show a popup detailview item...

    I use shortcut, but always got an error...

  • Gary L Cox Jr [DX-Squad]

    Re: xaf view from a custom window

    1/31/2010 11:42 AM
    • Top 50 Contributor
    • Joined on 9/9/2007
    • Austin, Tx
    • Posts 811

    Here is an example of creating a DetailView in Popup

    http://www.devexpress.com/Support/Center/p/Q95419.aspx

     

    Notice the Execute of the SimpleAction:

    private void simpleAction1_Execute(object sender, SimpleActionExecuteEventArgs e) {
                e.ShowViewParameters.Controllers.Add(new Solution1.Module.Web.PopupActionViewController(View as ListView));
                ObjectSpace objectSpace = Application.CreateObjectSpace();
                MyPopup myPopup = new MyPopup(objectSpace.Session, "Click OK to persist a new MyObject.");
                e.ShowViewParameters.CreatedView = Application.CreateDetailView(objectSpace, Application.FindDetailViewId(typeof(MyPopup)), true, myPopup);
                (e.ShowViewParameters.CreatedView as DetailView).ViewEditMode = DevExpress.ExpressApp.Editors.ViewEditMode.View;
                e.ShowViewParameters.Context = TemplateContext.PopupWindow;
                e.ShowViewParameters.TargetWindow = TargetWindow.Modal;
            }

  • xd yang

    Re: xaf view from a custom window

    2/2/2010 5:17 AM
    • Top 500 Contributor
    • Joined on 11/20/2008
    • Posts 41

    thanks for the reply. I already read this article, but my goal is to pop up from a custom web form.

    it is like : reuse the detail item (edit) from other web forums,

    I could use the full url:

    default.aspx?ShortcutViewID=object_detailview&....

    but I want to show the dialog without the left navbar, so my problem is the same as the original poster.

    I am not sure if XAF can do that...

  • Gary L Cox Jr [DX-Squad]

    Re: xaf view from a custom window

    2/2/2010 12:34 PM
    • Top 50 Contributor
    • Joined on 9/9/2007
    • Austin, Tx
    • Posts 811

    I had a similar requirement and got it working using the previous post link.  What I did was design my custom form using a UserControl, then created an ASPxPropertyEditor which looked something like this for loading the custom control:

    protected override object CreateControlCore() {
    return WebWindow.CurrentRequestPage.LoadControl("~/CustomUserControls/WebCustomUserControl.ascx");
    }


    Then I had a Controller for that custom object which had some Action buttons to handle what I needed.
    So the actual buttons were not on the UserControl but handled using the Framework.
  • xd yang

    Re: xaf view from a custom window

    2/5/2010 10:14 AM
    • Top 500 Contributor
    • Joined on 11/20/2008
    • Posts 41

    unfortunately, the web form I used is a silverlight web form, it is difficult to include in the createControlCore. so I have to jump xaf-- web form --call xaf detailview to reuse

  • xd yang

    Re: xaf view from a custom window

    2/5/2010 10:16 AM
    • Top 500 Contributor
    • Joined on 11/20/2008
    • Posts 41

    unfortunately, the web form I used is a silverlight web form, it is difficult to include in the createControlCore. so I have to jump xaf-- web form --call xaf detailview to reuse.

    I saw silmilar needs from others, but not sure if there is a solution. I can design a detailview web form out of xaf, but it is waste ...

  • Gary L Cox Jr [DX-Squad]

    Re: xaf view from a custom window

    2/5/2010 5:00 PM
    • Top 50 Contributor
    • Joined on 9/9/2007
    • Austin, Tx
    • Posts 811

    I have not tried using Silverlight within XAF but I think it still may be possible.  As I mentioned before create an ASPxPropertyEditor, then for the returning control you could dynamically create a UserControl and add the Silverlight tag in code or as the example I showed you in the prior post.

     

    Have a look at: <asp:Silverlight ID="Xaml1" runat="server" Source="~/ClientBin/SL2HttpPost.xap" Version="2.0" Width="100%" Height="100%" />

  • xd yang

    Re: xaf view from a custom window

    2/6/2010 12:42 AM
    • Top 500 Contributor
    • Joined on 11/20/2008
    • Posts 41

    thanks for your suggestion. I will try to include the Silverlight in the detail view.

    the problem is:

    the event is fired from the custom control, not the from the controller action. for example, I have a button in the custom user control, click it and popup the  detailview.

    how to link the action(pop up detailview) and the buttonClick?

  • wei chen

    Re: xaf view from a custom window

    2/9/2010 7:17 AM
    • Not Ranked
    • Joined on 6/16/2009
    • Posts 30
  • wei chen

    Re: xaf view from a custom window

    2/9/2010 7:21 AM
    • Not Ranked
    • Joined on 6/16/2009
    • Posts 30

    Are you chinese?

    QQ:4603528 Big Smile

  • johns johns

    Re: xaf view from a custom window

    2/20/2010 4:04 AM
    • Not Ranked
    • Joined on 2/20/2010
    • Posts 1

    Thanks for your good suggestion. I agree with you. :) :) :)

    When you travel niagara falls hotel remember that a foreign country is not designed to make you comfortable. It is designed to make its own people comfortable.
More from DevExpress
Live Chat
Have a pre-sales question?
Need assistance with your evaluation?
We are here to help.
Chat is one of the many ways you can contact members of the DevExpress Team. We are available Monday-Friday between 8:30am and 5:00pm Pacific Time.
If you need additional product information, require pre-sales assistance, or want help with your order, write to us at info@devexpress.com or call us at
+1 (818) 844-3383.