Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC

Activities of "Mitch"

Question

I've generated a number of views with the Rad Tool and I'm using it as a quick way to get started.

I'm then replacing the Rad Tool generated Controls with Telerik UI Core controls and it has worked well except for the validation aspect.

I've tried to replace the Abp validation with Telerik/Kendo validation and replaced the generated code with a Telerik/ Kendo equivalent.

this.save = function () {
    var validator = _$dpmsActivityInformationForm.data("kendoValidator");
    if (!validator.validate()) {
                    return;
    }

An example of my Telerik/Kendo controls is shown below and follows a more traditional MVC approach than the Rad Tool generated code.

<div class="form-group">
    <div class="editor-label">
        <label asp-for="DpmsActivity.StartDate"></label>
    </div>
    @(Html.Kendo().DateTimePickerFor(o => o.DpmsActivity.StartDate)
         .HtmlAttributes(new { style = "width:100%", @class = "form-control" })
     )
    @Html.ValidationMessageFor(m => m.DpmsActivity.StartDate)
</div>

As you can see my ViewModel has a hierarchy which is basically Model.DpmsActivity.StartDate etc.

All of my Client side validation seems to work well but when I go to save I get an error message "Your request is not valid!" as shown in the attachment. It says that fields are required even when they have been filled out! I'm not sure if this error message is generated client side or server side.

I'm wondering if this error message can simply be switched off or something can be done to get it to recognize the correct fields. When the fields were generated by the Rad Tool I noticed they were in the format of "startDate" rather than "DpmsActivity.StartDate" and I'm wondering if that is the issue. However, I don't know how to get it to look for "DpmsActivity.StartDate" instead.

I'm really pleased with the way the Telerik/Kendo client side validation is working, so I just want the error message that's shown in the attachment to either work correctly with "DpmsActivity.StartDate" etc or to be disabled.

That's great, thanks so much for pointing me in the right direction. I'm under a lot of time pressure so all help is appreciated.

By the way, I'm looking forward to Blazor becoming mainstream to minimize my need to use Javascript!

No, I'm more than happy to use some new or existing code. I just don't want to duplicate any existing methods that might be available that I'm not aware of.

As I mainly code in C#/MVC I often find JS less than easy to navigate so I was hoping for a bit of guidance from someone a with a bit more experience of JS/Boilerplate/Zero to show the best approach.

I need to change the standard behavior of _CreateOrEditModal.js for one of my Entities. Normally when saving, the modalManager closes the modal form and refreshes the underlying list. Instead I want to redirect to a different page and pass the Id of the newly created item.

However, I'm not sure how to obtain the new Id which in this case is a Guid. Using the example below I can easily access all of other fields from xyzClient, but not the Id which makes sense as it hasn't been generated at this point.

As I'm fairly new to Boilerplate/Zero, does anyone have any guidance how to get the new Id?

this.save = function () {
            if (!_$xyzClientInformationForm.valid()) {
                return;
            }

            var xyzClient = _$xyzClientInformationForm.serializeFormToObject();
			
			 _modalManager.setBusy(true);
			 _xyzClientsService.createOrEdit(
				xyzClient
			 ).done(function () {
               abp.notify.info(app.localize('SavedSuccessfully'));
               _modalManager.close();
              //Get rid of the following line
              // abp.event.trigger('app.createOrEditXyzClientModalSaved');
              //Replace with something like this
              //window.location.href = "/App/XyzClients/OpenFile?id=" + xyzClient.id;
			 }).always(function () {
               _modalManager.setBusy(false);
			});
        };

I have been using the Rad Tool to generate some Entities and quite a few have about 15 -20 fields. As a result the Modal pages that are generated can be quite long and require the page to be scrolled up and down to see the entire form.

Occasionally I have noticed that the page scrolling stops working and the only way to see the bottom part of the Modal dialog is to tab through the fields.

I have just managed to isolate what is causing the issue.

If the Rad Tool generated Entity has a Navigation Property, then the Generated Modal dialog includes a Pick tool to choose the related data. If you click on the Pick button and then close the dialog, the scrolling no longer works on the underlying Modal.

(It does this whether you choose an item from the Pick tool or not.)

Great to hear Blazor is on your radar.

I love using C#, MVC etc but Javascript has always been a pain. When I first saw the Blazor demos I thought.... bingo!

Keep up the great work and thanks for sharing with us that you've at least had a look at it.

That fixed it!

All of the ABP Nugets were 3.6.1 except for the ones in the .Core project which were 3.5.0. They're now been updated.

Many thanks!

I've tried to update from 5.3 to 5.4.1 of my Core jQuery project. I used the GitHub merge method and then manually merged about 20 files that needed human intervention.

I've eliminated all the errors but when I run the project I'm getting a Method not found error in Startup.cs when the ABP framework is initialized.

The error is

An error occurred while starting the application.
MissingMethodException: Method not found: 'Void Abp.Configuration.SettingDefinition..ctor(System.String, System.String, Abp.Localization.ILocalizableString, Abp.Configuration.SettingDefinitionGroup, Abp.Localization.ILocalizableString, Abp.Configuration.SettingScopes, Boolean, Boolean, System.Object)'.
Abp.Zero.Ldap.Configuration.LdapSettingProvider.GetSettingDefinitions(SettingDefinitionProviderContext context)
MissingMethodException: Method not found: 'Void Abp.Configuration.SettingDefinition..ctor(System.String, System.String, Abp.Localization.ILocalizableString, Abp.Configuration.SettingDefinitionGroup, Abp.Localization.ILocalizableString, Abp.Configuration.SettingScopes, Boolean, Boolean, System.Object)'.
Abp.Zero.Ldap.Configuration.LdapSettingProvider.GetSettingDefinitions(SettingDefinitionProviderContext context)
Abp.Configuration.SettingDefinitionManager.Initialize()
Abp.AbpKernelModule.PostInitialize()
Abp.Modules.AbpModuleManager+<>c.<StartModules>b__15_2(AbpModuleInfo module)
System.Collections.Generic.List.ForEach(Action<T> action)
Abp.Modules.AbpModuleManager.StartModules()
Abp.AbpBootstrapper.Initialize()
Abp.AspNetCore.AbpApplicationBuilderExtensions.InitializeAbp(IApplicationBuilder app)
Abp.AspNetCore.AbpApplicationBuilderExtensions.UseAbp(IApplicationBuilder app, Action<AbpApplicationBuilderOptions> optionsAction)
DpmsCloud.Web.Startup.Startup.Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) in Startup.cs
+
            app.UseAbp(options =>
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
Microsoft.AspNetCore.Hosting.ConventionBasedStartup.Configure(IApplicationBuilder app)
Microsoft.AspNetCore.Server.IISIntegration.IISSetupFilter+<>c__DisplayClass3_0.<Configure>b__0(IApplicationBuilder app)
Microsoft.AspNetCore.Hosting.Internal.AutoRequestServicesStartupFilter+<>c__DisplayClass0_0.<Configure>b__0(IApplicationBuilder builder)
Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()

I've attached a snapshot to show the exact error location.

Any ideas?

Thanks for clarifying that it's not built in functionality. It might be a nice thing to have sometime in the future.

There's a lot of discussion about it here. I've used something similar on previous projects and it really makes life easier and reduces human error.

[https://stackoverflow.com/questions/5940506/how-can-i-modify-labelfor-to-display-an-asterisk-on-required-fields])

I cannot seem to find a standard way within ASP Net Zero to automatically display Labels on required fields with a different style or asterisk.

Does this functionality exist?

If not, what approaches are being used by ASP Net Zero programmers to avoid manually styling each required input field?

Showing 71 to 80 of 103 entries