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

Activities of "Siyeza"

Hi, any progress on this? It is giving us some real problems. Was not tested proper..now it is on production

on the javascript above, see my comments below...if you can help with that

    var modal = _modalManager.getModal();
        //modal.find('Policy_InceptionDate').datetimepicker({      **//this brings up the DATE (BUT) the date picker stops working**
        modal.find('.date-picker').datetimepicker({                       **//this here does not bring up the DATE (BUT) datepicker continues to work**
            locale: abp.localization.currentLanguage.name,
            format: 'L'
        });

This is another RAD generated entity. See the property/field 'InceptionDate' which is of DateTime - when EDITING, that field doesnt get populated. See below. cshtml & js files


<div class="modal-body"> <div id="PolicyInformationsTab"> <form name="PolicyInformationsForm" role="form" novalidate class="form-validation">

        @if (Model.IsEditMode)
        {
            &lt;input type=&quot;hidden&quot; name=&quot;id&quot; value=&quot;@Model.Policy.Id&quot; /&gt;
        }


        &lt;div class=&quot;form-group m-form__group&quot;&gt;
            &lt;label for=&quot;PaymentDayDescrition&quot;&gt;@L("PaymentDay")&lt;/label&gt;
            &lt;div class=&quot;input-group&quot;&gt;
                &lt;input class=&quot;form-control&quot; id=&quot;PaymentDayDescrition&quot; name=&quot;paymentDayDescrition&quot; value=&quot;@Model.PaymentDayDescrition&quot; type=&quot;text&quot; disabled&gt;
                &lt;div class=&quot;input-group-append&quot;&gt;
                    &lt;button class=&quot;btn btn-primary blue&quot; id=&quot;OpenPaymentDayLookupTableButton&quot; type=&quot;button&quot;&gt;&lt;i class=&quot;fa fa-search&quot;&gt;&lt;/i&gt; @L("Pick")&lt;/button&gt;
                &lt;/div&gt;
                &lt;div class=&quot;input-group-prepend&quot;&gt;
                    &lt;button class=&quot;btn btn-danger&quot; type=&quot;button&quot; id=&quot;ClearPaymentDayDescritionButton&quot;&gt;&lt;i class=&quot;fa fa-times&quot;&gt;&lt;/i&gt;&lt;/button&gt;
                &lt;/div&gt;
            &lt;/div&gt;
        &lt;/div&gt;

        @if (Model.IsEditMode)
        {
            &lt;input class=&quot;form-control&quot; value=&quot;@Model.Policy.PaymentDayId&quot; type=&quot;text&quot; name=&quot;paymentDayId&quot; required hidden /&gt;
        }
        else
        {
            &lt;input class=&quot;form-control&quot; value=&quot;&quot; type=&quot;text&quot; name=&quot;paymentDayId&quot; required hidden /&gt;
        }


        &lt;div class=&quot;form-group m-form__group&quot;&gt;
            &lt;label for=&quot;PolicyStatusDescription&quot;&gt;@L("PolicyStatus")&lt;/label&gt;
            &lt;div class=&quot;input-group&quot;&gt;
                &lt;input class=&quot;form-control&quot; id=&quot;PolicyStatusDescription&quot; name=&quot;policyStatusDescription&quot; value=&quot;@Model.PolicyStatusDescription&quot; type=&quot;text&quot; disabled&gt;
                &lt;div class=&quot;input-group-append&quot;&gt;
                    &lt;button class=&quot;btn btn-primary blue&quot; id=&quot;OpenPolicyStatusLookupTableButton&quot; type=&quot;button&quot;&gt;&lt;i class=&quot;fa fa-search&quot;&gt;&lt;/i&gt; @L("Pick")&lt;/button&gt;
                &lt;/div&gt;
                &lt;div class=&quot;input-group-prepend&quot;&gt;
                    &lt;button class=&quot;btn btn-danger&quot; type=&quot;button&quot; id=&quot;ClearPolicyStatusDescriptionButton&quot;&gt;&lt;i class=&quot;fa fa-times&quot;&gt;&lt;/i&gt;&lt;/button&gt;
                &lt;/div&gt;
            &lt;/div&gt;
        &lt;/div&gt;

        @if (Model.IsEditMode)
        {
            &lt;input class=&quot;form-control&quot; value=&quot;@Model.Policy.PolicyStatusId&quot; type=&quot;text&quot; name=&quot;policyStatusId&quot; required hidden /&gt;
        }
        else
        {
            &lt;input class=&quot;form-control&quot; value=&quot;&quot; type=&quot;text&quot; name=&quot;policyStatusId&quot; required hidden /&gt;
        }


        &lt;div class=&quot;form-group m-form__group&quot;&gt;
            &lt;label for=&quot;PolicyTypeDescription&quot;&gt;@L("PolicyType")&lt;/label&gt;
            &lt;div class=&quot;input-group&quot;&gt;
                &lt;input class=&quot;form-control&quot; id=&quot;PolicyTypeDescription&quot; name=&quot;policyTypeDescription&quot; value=&quot;@Model.PolicyTypeDescription&quot; type=&quot;text&quot; disabled&gt;
                &lt;div class=&quot;input-group-append&quot;&gt;
                    &lt;button class=&quot;btn btn-primary blue&quot; id=&quot;OpenPolicyTypeLookupTableButton&quot; type=&quot;button&quot;&gt;&lt;i class=&quot;fa fa-search&quot;&gt;&lt;/i&gt; @L("Pick")&lt;/button&gt;
                &lt;/div&gt;
                &lt;div class=&quot;input-group-prepend&quot;&gt;
                    &lt;button class=&quot;btn btn-danger&quot; type=&quot;button&quot; id=&quot;ClearPolicyTypeDescriptionButton&quot;&gt;&lt;i class=&quot;fa fa-times&quot;&gt;&lt;/i&gt;&lt;/button&gt;
                &lt;/div&gt;
            &lt;/div&gt;
        &lt;/div&gt;

        @if (Model.IsEditMode)
        {
            &lt;input class=&quot;form-control&quot; value=&quot;@Model.Policy.PolicyTypeId&quot; type=&quot;text&quot; name=&quot;policyTypeId&quot; required hidden /&gt;
        }
        else
        {
            &lt;input class=&quot;form-control&quot; value=&quot;&quot; type=&quot;text&quot; name=&quot;policyTypeId&quot; required hidden /&gt;
        }


        &lt;div class=&quot;form-group m-form__group&quot;&gt;
            &lt;label for=&quot;PolicyHolderFullNames&quot;&gt;@L("PolicyHolder")&lt;/label&gt;
            &lt;div class=&quot;input-group&quot;&gt;
                &lt;input class=&quot;form-control&quot; id=&quot;PolicyHolderFullNames&quot; name=&quot;policyHolderFullNames&quot; value=&quot;@Model.PolicyHolderFullNames&quot; type=&quot;text&quot; disabled&gt;
                &lt;div class=&quot;input-group-append&quot;&gt;
                    &lt;button class=&quot;btn btn-primary blue&quot; id=&quot;OpenPolicyHolderLookupTableButton&quot; type=&quot;button&quot;&gt;&lt;i class=&quot;fa fa-search&quot;&gt;&lt;/i&gt; @L("Pick")&lt;/button&gt;
                &lt;/div&gt;
                &lt;div class=&quot;input-group-prepend&quot;&gt;
                    &lt;button class=&quot;btn btn-danger&quot; type=&quot;button&quot; id=&quot;ClearPolicyHolderFullNamesButton&quot;&gt;&lt;i class=&quot;fa fa-times&quot;&gt;&lt;/i&gt;&lt;/button&gt;
                &lt;/div&gt;
            &lt;/div&gt;
        &lt;/div&gt;

        @if (Model.IsEditMode)
        {
            &lt;input class=&quot;form-control&quot; value=&quot;@Model.Policy.PolicyHolderId&quot; type=&quot;text&quot; name=&quot;policyHolderId&quot; required hidden /&gt;
        }
        else
        {
            &lt;input class=&quot;form-control&quot; value=&quot;&quot; type=&quot;text&quot; name=&quot;policyHolderId&quot; required hidden /&gt;
        }




        &lt;div class=&quot;form-group&quot;&gt;
            &lt;label for=&quot;Policy_ReferenceNumber&quot;&gt;@L("ReferenceNumber")&lt;/label&gt;
            &lt;input class=&quot;form-control&quot; id=&quot;Policy_ReferenceNumber&quot; value=&quot;@Model.Policy.ReferenceNumber&quot; type=&quot;text&quot; name=&quot;referenceNumber&quot; required maxlength=&quot;@insureserve.Main.Policy.PolicyConsts.MaxReferenceNumberLength&quot; minlength=&quot;@insureserve.Main.Policy.PolicyConsts.MinReferenceNumberLength&quot; /&gt;
        &lt;/div&gt;




       &lt;div class=&quot;form-group&quot;&gt;
            &lt;label for=&quot;Policy_InceptionDate&quot;&gt;@L("InceptionDate")&lt;/label&gt;
            &lt;input class=&quot;form-control m-input date-picker&quot; id=&quot;Policy_InceptionDate&quot; type=&quot;text&quot; name=&quot;inceptionDate&quot; value=&quot;@Model.Policy.InceptionDate&quot; /&gt;
        &lt;/div&gt;


    &lt;/form&gt;
&lt;/div&gt;

</div>

SCRIPT

(function ($) { app.modals.CreateOrEditPolicyModal = function () {

    var _policiesService = abp.services.app.policies;

    var _modalManager;
    var _$policyInformationForm = null;

    var _paymentDayLookupTableModal = new app.ModalManager({
        viewUrl: abp.appPath + 'App/Policies/PaymentDayLookupTableModal',
        scriptUrl: abp.appPath + 'view-resources/Areas/App/Views/Policies/_PaymentDayLookupTableModal.js',
        modalClass: 'PaymentDayLookupTableModal'
    }); var _policyStatusLookupTableModal = new app.ModalManager({
        viewUrl: abp.appPath + 'App/Policies/PolicyStatusLookupTableModal',
        scriptUrl: abp.appPath + 'view-resources/Areas/App/Views/Policies/_PolicyStatusLookupTableModal.js',
        modalClass: 'PolicyStatusLookupTableModal'
    }); var _policyTypeLookupTableModal = new app.ModalManager({
        viewUrl: abp.appPath + 'App/Policies/PolicyTypeLookupTableModal',
        scriptUrl: abp.appPath + 'view-resources/Areas/App/Views/Policies/_PolicyTypeLookupTableModal.js',
        modalClass: 'PolicyTypeLookupTableModal'
    }); var _policyHolderLookupTableModal = new app.ModalManager({
        viewUrl: abp.appPath + 'App/Policies/PolicyHolderLookupTableModal',
        scriptUrl: abp.appPath + 'view-resources/Areas/App/Views/Policies/_PolicyHolderLookupTableModal.js',
        modalClass: 'PolicyHolderLookupTableModal'
    });

    this.init = function (modalManager) {
        _modalManager = modalManager;

        var modal = _modalManager.getModal();
        modal.find('.date-picker').datetimepicker({
            locale: abp.localization.currentLanguage.name,
            format: 'L'
        });

        _$policyInformationForm = _modalManager.getModal().find('form[name=PolicyInformationsForm]');
        _$policyInformationForm.validate();
    };

    $('#OpenPaymentDayLookupTableButton').click(function () {

        var policy = _$policyInformationForm.serializeFormToObject();

        _paymentDayLookupTableModal.open({ id: policy.paymentDayId, displayName: policy.paymentDayDescrition }, function (data) {
            _$policyInformationForm.find('input[name=paymentDayDescrition]').val(data.displayName);
            _$policyInformationForm.find('input[name=paymentDayId]').val(data.id);
        });
    });

    $('#ClearPaymentDayDescritionButton').click(function () {
        _$policyInformationForm.find('input[name=paymentDayDescrition]').val('');
        _$policyInformationForm.find('input[name=paymentDayId]').val('');
    });

    $('#OpenPolicyStatusLookupTableButton').click(function () {

        var policy = _$policyInformationForm.serializeFormToObject();

        _policyStatusLookupTableModal.open({ id: policy.policyStatusId, displayName: policy.policyStatusDescription }, function (data) {
            _$policyInformationForm.find('input[name=policyStatusDescription]').val(data.displayName);
            _$policyInformationForm.find('input[name=policyStatusId]').val(data.id);
        });
    });

    $('#ClearPolicyStatusDescriptionButton').click(function () {
        _$policyInformationForm.find('input[name=policyStatusDescription]').val('');
        _$policyInformationForm.find('input[name=policyStatusId]').val('');
    });

    $('#OpenPolicyTypeLookupTableButton').click(function () {

        var policy = _$policyInformationForm.serializeFormToObject();

        _policyTypeLookupTableModal.open({ id: policy.policyTypeId, displayName: policy.policyTypeDescription }, function (data) {
            _$policyInformationForm.find('input[name=policyTypeDescription]').val(data.displayName);
            _$policyInformationForm.find('input[name=policyTypeId]').val(data.id);
        });
    });

    $('#ClearPolicyTypeDescriptionButton').click(function () {
        _$policyInformationForm.find('input[name=policyTypeDescription]').val('');
        _$policyInformationForm.find('input[name=policyTypeId]').val('');
    });

    $('#OpenPolicyHolderLookupTableButton').click(function () {

        var policy = _$policyInformationForm.serializeFormToObject();

        _policyHolderLookupTableModal.open({ id: policy.policyHolderId, displayName: policy.policyHolderFullNames }, function (data) {
            _$policyInformationForm.find('input[name=policyHolderFullNames]').val(data.displayName);
            _$policyInformationForm.find('input[name=policyHolderId]').val(data.id);
        });
    });

    $('#ClearPolicyHolderFullNamesButton').click(function () {
        _$policyInformationForm.find('input[name=policyHolderFullNames]').val('');
        _$policyInformationForm.find('input[name=policyHolderId]').val('');
    });



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

        var policy = _$policyInformationForm.serializeFormToObject();

        _modalManager.setBusy(true);
        _policiesService.createOrEdit(
            policy
        ).done(function () {
            abp.notify.info(app.localize('SavedSuccessfully'));
            _modalManager.close();
            abp.event.trigger('app.createOrEditPolicyModalSaved');
        }).always(function () {
            _modalManager.setBusy(false);
        });
    };
};

})(jQuery);

Hi, I have raised the issue - Form Validation - on navigation properties (generated by RAD tool) #3129

Yes, by powertools attached is the generated Dto for Add&Edit see below ...

public class CreateOrEditPolicyHolderDto : EntityDto<long?> {

    [Required]
    [StringLength(PolicyHolderConsts.MaxFullNamesLength, MinimumLength = PolicyHolderConsts.MinFullNamesLength)]
    public string FullNames { get; set; }


    [Required]
    [StringLength(PolicyHolderConsts.MaxLastNameLength, MinimumLength = PolicyHolderConsts.MinLastNameLength)]
    public string LastName { get; set; }


    [Required]
    [StringLength(PolicyHolderConsts.MaxIDNumberLength, MinimumLength = PolicyHolderConsts.MinIDNumberLength)]
    public string IDNumber { get; set; }


    public int PreferredCommunicationId { get; set; }

    public int GenderId { get; set; }

    public int TitleId { get; set; }

    public int RaceId { get; set; }

    public int PolicyHolderStatusId { get; set; }

    public long? OrganizationUnitId { get; set; }

}
Answer

Turns out your suggestion there works really well and if you want to ignore (say entities that are not assigned to unit)...this below does the trick.

.... entities not assing to any org unit will be shown to everyone.

(yourOrgnanisationalUnitCodes.Contains(x....somecode) ||string.IsNullOrWhiteSpace(x...somecode))

refer to logins (#8759) 360 View - > Create new policy holder (top right) -> Save (just click save without filling any data). Form Validation is not happening on dropdowns. Attached image to support. Those errors I sent ealier are server errors.

Answer

Let me work on this, I will let u know

https://insureserveuat.co.za/ client : Default (case sensitive) username : maliming password : 1020

Main->Policies->'Actions'-Edit (you will notice that there is a field there Inception Date), but when you select 'Edit' it is not binded into the dialog

I hope this is clear...

so this I will have to self implement I guess :)

Showing 31 to 40 of 82 entries