[CLOSED] Model Direct Event is not working after getting latest from the SVN

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    [CLOSED] Model Direct Event is not working after getting latest from the SVN

    It seems like the Direct Event for Model is now broken . Please take a look at the same sample from Ext.net MVC demo
    @model Ext.Net.MVC.Examples.Areas.Models.Person
    
    @{
        ViewBag.Title = "Submit";
        Layout = "~/Views/Shared/_BaseLayout.cshtml";
    }
    
    @section headtag
    {
        <script>
            function success (btn) {
                submit(btn.up('window').down('form'), '@Url.Action("SuccessSubmit")');
            }
    
            function failure (btn) {
                submit(btn.up('window').down('form'), '@Url.Action("FailureSubmit")');
            }
            
            function submit(form, url)
            {
                form.submit({
                    url: url,
                    waitMsg : "Submitting...",
                    success: function(form, action){
                        // server responded with success = true
                        var result = action.result;                    
                    },
                    failure: function(form, action){
                        if (action.failureType === Ext.form.action.Action.CONNECT_FAILURE) {
                            Ext.Msg.alert('Error',
                                'Status:'+action.response.status+': '+
                                action.response.statusText);
                        }
                        if (action.failureType === Ext.form.action.Action.SERVER_INVALID){
                            // server responded with success = false
                            Ext.Msg.alert('Invalid', action.result.errorMessage);
                        }
                    }
                })
            }
        </script>
    }
    
    @section example
    {    
        @(
     Html.X().Window()
                .Title("Submit")
                .Width(250)
                .Height(220)
                .Layout(LayoutType.Fit)
                .Closable(false)
                .Border(false)
                .Items(
                    Html.X().FormPanel()
                        .ID("FormPanel1")
                        .Frame(true)
                        .DefaultAnchor("100%")
                        .BodyPadding(6)
                        .FieldDefaults(def =>
                        {
                            def.MsgTarget = MessageTarget.Side;
                        })
                        .Items(
                            Html.X().HiddenFor(m => m.ID),
                            Html.X().TextFieldFor(m => m.FirstName),
                            Html.X().TextFieldFor(m => m.LastName),
                            Html.X().DateFieldFor(m => m.DateOfBirth),
                            Html.X().ComboBoxFor(m => m.Sex),
                            Html.X().CheckboxFor(m => m.Approved)
                        )
                )
                .Buttons(
                    Html.X().Button()
                        .Text("Submit variations")
                        .MenuItem(
                            Html.X().MenuItem().Text("FormPanel submit - Success").Handler("success"),
                            Html.X().MenuItem().Text("FormPanel submit - Failure").Handler("failure"),
                            Html.X().MenuItem()
                                .Text("DirectEvent submit")
                                .DirectEvents(de => {
                                    de.Click.Url = Url.Action("DirectEventSubmit");
                                    de.Click.EventMask.ShowMask = true;
                                    de.Click.FormID = "FormPanel1";
                                })
                        )
                )
        )
    }
    When Direct Submit is clicked values are null from the text field? Can we please get a fix as this is being used in our app and now it stopped working.

    Click image for larger version. 

Name:	DirectEvent Model issue.png 
Views:	94 
Size:	17.5 KB 
ID:	5424
    Last edited by Daniil; Jan 16, 2013 at 1:40 PM. Reason: [CLOSED]

Similar Threads

  1. Replies: 0
    Last Post: Oct 30, 2012, 5:34 PM
  2. Replies: 2
    Last Post: Aug 30, 2012, 9:37 PM
  3. Replies: 5
    Last Post: Sep 19, 2011, 8:20 PM
  4. Replies: 3
    Last Post: Mar 23, 2011, 5:32 PM
  5. Replies: 3
    Last Post: Apr 20, 2010, 12:21 PM

Posting Permissions