Base solution for your next web application

Activities of "PhilWynn"

Answer

Hi,

I can do this. What I don't understand though, is that all the screen shots I see in the Development Guide (e.g. User Management section) have the single dropdown button. Is this a mistake in the documentation?

Regards

Answer

Okay, thank you.

Yes, the problem turned out to be the StartUp Project selection.

Thank you.

Answer

Yes, I am now seeing this.

Thank you.

Answer

Hi,

I am using the current MVC5 jQuery version. I do indeed apply the [DontWrapResult] attribute to my action methods to get this working. Kendo automatically calls the ajax methods required and I am therefore unable to use abp.ajax . However, I would really like to maintain consistency in the way I handle ajax errors.

The code below shows how I use Kendo to set up a datasource. Where I have the TODO comment, I would like to be able to invoke the standard abp ajax error dialog:

function buildDataSource() {
            return new kendo.data.DataSource({
                type: "aspnetmvc-ajax",
                transport: {
                    read: {
                        url: "/Users/GetUsers",
                        data: {
                            filterText: $('#UsersTableFilter').val()
                        }
                    }
                },
                schema: {
                    data: 'data',
                    total: 'total',
                    errors: 'error'
                },
                error: function (e) {
                    //TODO
                    //alert(e.errors.message); 
                },
                pageSize: 10,
                serverPaging: true,
                serverSorting: true
            });
        }
Answer

Thanks, that was what I was looking for.

Is the javascript API documented anywhere?

Answer

Fantastic. Thanks for the help..

Answer

Hi,

I am not really sure how that post will help me with my current issue. I need to present the localized value of an enum on a modal form. The code I have is as follows:

public enum ProcessingType
    {
        [Display(Name = "Standard")]
        Standard = 1,
        [Display(Name = "Off cycle")]
        OffCycle = 2,
        [Display(Name = "End of year")]
        EndOfYear = 3
    }

public class HeadlineTaskDto
{
        ...
        public ProcessingType ProcessingType { get; set; }
       ...
}

public static class EnumExtensions
    {
        public static string GetDisplayName(this Enum enumValue)
        {
            return enumValue.GetType()
                            .GetMember(enumValue.ToString())
                            .First()
                            .GetCustomAttribute<DisplayAttribute>()
                            .GetName();
        }
    }

...
<div class="col-md-3">
        <div class="form-group form-md-line-input form-md-floating-label">
             <div class="form-control form-control-static">@Model.Task.ProcessingType.GetDisplayName()</div>
                <label>Type</label>
        </div>
</div>
...

I'm not sure how a client side constant would help me here?

Yes, the validation error appears in the console as expected. No javascript errors are reported. Another interesting thing to note is when I apply the following error handler:

function _attachCloseEvent() {
            _modalManager.getModal().find('.issue-close').click(function (e) {
                e.preventDefault();
                if (!_closeIssueForm.valid()) {
                    return;
                }
                abp.message.confirm(
                    app.localize('IssueCloseWarningMessage'),
                    function (isConfirmed) {
                        if (isConfirmed) {                            
                            _modalManager.setBusy(true);
                            var issue = _closeIssueForm.serializeFormToObject();
                            abp.ajax({
                                url: abp.appPath + 'Mpa/Issues/CloseIssue',
                                data: JSON.stringify({
                                    issueOutput: issue
                                }),
                                success: function () {                                    
                                    abp.notify.success(app.localize('IssueSuccessfullyClosed'));
                                    _modalManager.close();
                                    abp.event.trigger('app.itemSaved');
                                },
                                error: function () {
                                    alert('error');
                                },
                                always: (function() {
                                    _modalManager.setBusy(false);
                                })
                            });
                        }
                    }
                );
            });
        }

In this case, the validation dialog appear correctly while the alert box is shown, but when I dismiss the alert box the validation dialog disappears.

Hi,

This issue is very easy to reproduce on the initial az code, e.g. creating a User:

  • Remove the 'required' attribute from a field in _CreateOrEditModal.cshtml
  • Fill in the form, leaving this field empty
  • On save, validation message comes from server
  • Now edit _CreateOrEditModal.js 'save' so that the call to userService uses abp.message.confirm
  • On save, no validation message from the server
Showing 1 to 10 of 75 entries