Update: So my current understanding that the features will only show up in the AbpFeatures table when a non-default value is specified. Using the FeatureChecker.GetValueAsync functionality will return either the default value (presumably from the feature definition) or the non-default value from the database.
Hi @ismcagdas,
Yes we are trying to open a modal.
What type of exceptions can the ModalManager handle? a UserFriendlyException or another type?
Thanks,
David
I've looked at that document previosuly, and it doesn't help to clarify the situation.
Reading through it and the associated links, it details an abp ajax call can be made like so:
abp.ajax({
url: '/People/SavePerson',
data: JSON.stringify(newPerson)
}).done(function(data) {
abp.notify.success('Created new person with id = ' + data.personId);
});
And any errors returning from this can be handled and displayed via the abp.message.error function.
However the modal isn't called via an ajax method as show above, it's called via the action function of a datatable:
action: function (data) {
_manageACLModal.open({ entityid: data.record.id, entityname: data.record.name });
}
How do you check for a returning error from this call method?
Hi @maliming
On throwing the UserFriendlyException a 500 error is being returned to the browser (and the request fails to complete)
Thanks
Thank you for your help @alirizaadiyahsi, much appreciated and really helped me out.
Hi Alirizaadiyahsi,
The project is ASP.NET Core MVC Zero Version 5.6.
There aren't any errors - a dropdown element placed in a view simply doesn't have the dropdown behaviour. Code example:
<div class="m-dropdown m-dropdown--inline m-dropdown--arrow m-dropdown--align-right" m-dropdown-toggle="click">
<a href="#" class="m-dropdown__toggle btn btn-sm btn-primary dropdown-toggle">
Dropdown - Click
</a>
<div class="m-dropdown__wrapper">
<span class="m-dropdown__arrow m-dropdown__arrow--left"></span>
<div class="m-dropdown__inner">
<div class="m-dropdown__body">
<div class="m-dropdown__content">
<ul class="m-nav">
<li class="m-nav__section m-nav__section--first">
<span class="m-nav__section-text">Section</span>
</li>
<li class="m-nav__item">
<a href="" class="m-nav__link">
<i class="m-nav__link-icon flaticon-share"></i>
<span class="m-nav__link-text">Activity</span>
</a>
</li>
<li class="m-nav__item">
<a href="" class="m-nav__link">
<i class="m-nav__link-icon flaticon-chat-1"></i>
<span class="m-nav__link-text">Messages</span>
</a>
</li>
<li class="m-nav__item">
<a href="" class="m-nav__link">
<i class="m-nav__link-icon flaticon-info"></i>
<span class="m-nav__link-text">FAQ</span>
</a>
</li>
<li class="m-nav__item">
<a href="" class="m-nav__link">
<i class="m-nav__link-icon flaticon-lifebuoy"></i>
<span class="m-nav__link-text">Support</span>
</a>
</li>
<li class="m-nav__separator m-nav__separator--fit">
</li>
<li class="m-nav__item">
<a href="#" class="btn btn-outline-danger m-btn m-btn--pill m-btn--wide btn-sm">Logout</a>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
Similar dropdown classes used in the top navigation bar (i.e. notifications uses a dropdown element) so relevant js is included/works in the top menu but not in the view body?
Here is the stack trace info in question:
{System.NullReferenceException: Object reference not set to an instance of an object. at Syntaq.Falcon.Documents.DocumentsAppService.Automate(Object JSONObject) in D:\Source\Syntaq.Falcon\src\Syntaq.Falcon.Application\Documents\DocumentsAppService.cs:line 88}
The null object is the _unitOfWorkManager.Current.
Line 88 is marked below:
84: using (var uow = _unitOfWorkManager.Begin(TransactionScopeOption.RequiresNew))
85: {
86: NewRecord = _recordRepository.Get(Guid.Parse(RecordID));
87: await CreateOrEditRecord(NewRecord);
88: await _unitOfWorkManager.Current.SaveChangesAsync();
Hi Aaron
Thanks for the clarification around async awaiting.
Here is the code we're currently trying to execute our functions from within:
using (var uow = _unitOfWorkManager.Begin(TransactionScopeOption.RequiresNew))
{
NewRecord = _recordRepository.Get(Guid.Parse(RecordID));
await CreateOrEditRecord(NewRecord);
await _unitOfWorkManager.Current.SaveChangesAsync();
NewRecordMatter = _recordMatterRepository.Get(Guid.Parse(RecordMatterID));
await CreateOrEditRecordMatter(NewRecordMatter);
await _unitOfWorkManager.Current.SaveChangesAsync();
await uow.CompleteAsync();
}
Here is one of the functions sets that get called. Each of the function sets follows the same pattern as this one.
public async Task CreateOrEditRecord(Record Record)
{
if (Record.Id == null || !_recordRepository.GetAll().Any(i => i.Id == Record.Id))
{
await CreateRecord(Record);
}
else
{
await UpdateRecord(Record);
}
}
[AbpAuthorize(AppPermissions.Pages_Records_Create)]
private async Task CreateRecord(Record Record)
{
await _recordRepository.InsertAsync(Record);
}
[AbpAuthorize(AppPermissions.Pages_Records_Edit)]
private async Task UpdateRecord(Record Record)
{
var record = await _recordRepository.FirstOrDefaultAsync((Guid)Record.Id);
ObjectMapper.Map(Record, record);
}
The current UOW seems to get closed when returning from CreateOrEditRecord(), which disrupts the subsequent actions shown in the top code block.
Running the functions synchronously
_recordsFolderManager.CreateOrEditFolder(NewFolder);
_recordManager.CreateOrEditRecord(NewRecord);
_recordManager.CreateOrEditRecordMatter(NewRecordMatter);
_recordManager.CreateOrEditRecordMatterItem(NewRecordMatterItem);
Running the functions asynchronously
await _recordsFolderManager.CreateOrEditFolder(NewFolder);
await _recordManager.CreateOrEditRecord(NewRecord);
await _recordManager.CreateOrEditRecordMatter(NewRecordMatter);
await _recordManager.CreateOrEditRecordMatterItem(NewRecordMatterItem);
We're also tried runnning the functions in a new unit of work
using (var unitOfWork = _unitOfWorkManager.Begin())
{
await _recordsFolderManager.CreateOrEditFolder(NewFolder);
await _recordManager.CreateOrEditRecord(NewRecord);
await _recordManager.CreateOrEditRecordMatter(NewRecordMatter);
await _recordManager.CreateOrEditRecordMatterItem(NewRecordMatterItem);
unitOfWork.Complete();
}
Thank you for your responses @mumfie and @alper.
For the clarity of future readers, this question wasn't in regards to loading partial views into modals but rather loading partial views inside of full views.
The solution turned out to be that the partial view needed its own model as it couldn't/wasn't reading the model in the parent view.