I ran into an issue where the "callback" from the Dialog is not causing the parent page to refresh the data even after calling StateHasChanged(). Might I be missing something. Everything else works amazingly by the way! Code snippets are in page order below...
**Html for displaying the value...**
<div class="col-sm-8" style="padding-top:20px">
<table>
<tr>
<td><label>Linked Request: </label></td>
<td><button class="btn btn-primary btn-sm" type="button" @onclick="() => ShowRequestPicker()">Select Request</button></td>
</tr>
<tr>
<td>
<label>@_allLinked</label>
@* @foreach (int requestID in requestJ.LinkedRequests)
{
<Label>@requestID</Label>
}*@
</td>
<td></td>
</tr>
</table>
</div>
//opening the dialog
async Task ShowRequestPicker()
{
RequestData rd = new RequestData(currentUser.UserID, "", Globals.AppType,
Globals.OSVersion, Globals.AppVersion, Globals.BaseServiceUrl);
List<Request> myOpenRequests = await rd.GetAllOpenRequests(currentUser.EmployeeNumber, currentUser.UserID);
var result = await DialogService.OpenAsync("Request Linking", ds =>
@<div>
<div>
<p class="mb-4">Select a Request to Link to</p>
<RadzenButton Text="Cancel" Click="() => ds.Close(false)" Style="float:right;margin-bottom:50px" ButtonStyle="ButtonStyle.Secondary" Class="mr-1" />
</div>
<br>
<div class="row">
<div class="col">
</div>
</div>
<div class="row">
<div class="col" style="max-height:500px;width:780px;margin-top:30px">
<table class="table table-striped table-bordered">
<thead>
<tr>
<th></th>
<th>Req#</th>
<th>Problem</th>
</tr>
</thead>
<tbody>
@foreach (Request reqs in @myOpenRequests)
{
<tr>
<td><button class="btn btn-link" style="width:95%;height=50%;font-size:12px" @onclick="@(e => OnSelectedLinkClicked(reqs, ds))">Link</button></td>
<td>@reqs.Id.ToString()</td>
<td>@((MarkupString)@reqs.Problem)</td>
</tr>
}
</tbody>
</table>
</div>
</div>
</div>
,new DialogOptions() { Width = "700px", Height = "570px", Resizable = false, Draggable = true, ShowClose = false, } );
}
protected async void OnSelectedLinkClicked(Request req, DialogService ds)
{
List<int> r = requestJ.LinkedRequests.FindAll(x => x == req.Id);
if (r.Count == 0)
{
requestJ.LinkedRequests.Add(req.Id);
_allLinked = req.Id.ToString(); //value to be updated in HTML
ds.Close();
}
StateHasChanged();
}