DaClownie
DaClownie
CC#
Created by DaClownie on 2/2/2025 in #help
Parameter count mismatch error when trying to change what is being displayed in a Blazor application
ty for your help, both of you
14 replies
CC#
Created by DaClownie on 2/2/2025 in #help
Parameter count mismatch error when trying to change what is being displayed in a Blazor application
Yea, going the modal method was so much easier. I may revisit this later just to figure out why it wouldn't work because its a good learning, but in the vein of just carrying on with my work, modal will be the way
14 replies
CC#
Created by DaClownie on 2/2/2025 in #help
Parameter count mismatch error when trying to change what is being displayed in a Blazor application
Yep, still no luck. Never displays the @if (editAssessment) block. I'm going to find a new way and move on. Maybe having an edit modal overlay instead would be easier. just a div centered in the middle of the screen being passed an object. How hard can it be lol
14 replies
CC#
Created by DaClownie on 2/2/2025 in #help
Parameter count mismatch error when trying to change what is being displayed in a Blazor application
Ok, updated and same effect. Unfortunately I’m not even reaching the point that those elements are displaying. It’s failing prior. I may need to just come up with a different approach. Push the edit to a new page and move on despite it being less than optimal.
14 replies
CC#
Created by DaClownie on 2/2/2025 in #help
Parameter count mismatch error when trying to change what is being displayed in a Blazor application
Ok, so for some additional information: if I change
<button class="btn btn-primary"
onclick="@(() => editAssessment = true)">
<i class="bi-pencil-square" />
</button>
<button class="btn btn-primary"
onclick="@(() => editAssessment = true)">
<i class="bi-pencil-square" />
</button>
the onclick will throw an error before even attempting to run that. I have a breakpoint there and it never hits for it. It gets the parameter mismatch instantly. If I change that call to
<button class="btn btn-primary"
@onclick="(() => editAssessment = true)">
<i class="bi-pencil-square" />
</button>
<button class="btn btn-primary"
@onclick="(() => editAssessment = true)">
<i class="bi-pencil-square" />
</button>
it will run the code, but the value of editAssessment doesn't change to true like it it set to do, and it never renders the edit block of code as shown below:
@if (editAssessment)
{
<EditForm Model="updateAssessment" OnValidSubmit="() => HandleEditSubmit(updateAssessment)">
<InputText id="name" placeholder="Name:" @bind-Value="updateAssessment.Name" />
<InputDate Type="InputDateType.DateTimeLocal" id="dateStart" @bind-Value="updateAssessment.DateStart" />
<InputDate Type="InputDateType.DateTimeLocal" min="@updateAssessment.DateStart" id="dateEnd" @bind-Value="updateAssessment.DateEnd" />
<button type="submit" class="btn btn-primary mt-4">Submit</button>
<button type="button" class="btn btn-close" @onclick="() => editAssessment = false" />
</EditForm>
}
@if (editAssessment)
{
<EditForm Model="updateAssessment" OnValidSubmit="() => HandleEditSubmit(updateAssessment)">
<InputText id="name" placeholder="Name:" @bind-Value="updateAssessment.Name" />
<InputDate Type="InputDateType.DateTimeLocal" id="dateStart" @bind-Value="updateAssessment.DateStart" />
<InputDate Type="InputDateType.DateTimeLocal" min="@updateAssessment.DateStart" id="dateEnd" @bind-Value="updateAssessment.DateEnd" />
<button type="submit" class="btn btn-primary mt-4">Submit</button>
<button type="button" class="btn btn-close" @onclick="() => editAssessment = false" />
</EditForm>
}
14 replies
CC#
Created by DaClownie on 2/2/2025 in #help
Parameter count mismatch error when trying to change what is being displayed in a Blazor application
However, that block of code isn't even getting a chance to run when setting breakpoints
14 replies
CC#
Created by DaClownie on 2/2/2025 in #help
Parameter count mismatch error when trying to change what is being displayed in a Blazor application
I tried putting @ in both of those locations but it gets an error for that syntax. On the first, OnValidSubmit is a Parameter of the Editform component and its syntax is like shown if i'm passing a variable (as far as I can tell), on the second, the@onclick is to handle the EventCallback for the mouse event and set the local variable, editAssessment to false
14 replies
CC#
Created by DaClownie on 2/2/2025 in #help
Parameter count mismatch error when trying to change what is being displayed in a Blazor application
As far as I can tell, it should be monitoring for the changing of the state of the variable and removing the else if from displaying and rendering the if portion, but it errors while still keeping the else if displayed with the above code. I'm sure I'm misinterpreting how the rendering works but I'm not quite sure how else to handle the displaying/editing in the same line
14 replies
CC#
Created by DaClownie on 2/2/2025 in #help
Parameter count mismatch error when trying to change what is being displayed in a Blazor application
crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
Unhandled exception rendering component: Parameter count mismatch.
System.Reflection.TargetParameterCountException: Parameter count mismatch.
at System.Reflection.MethodBaseInvoker.ThrowTargetParameterCountException()
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at System.Delegate.DynamicInvokeImpl(Object[] args)
at System.MulticastDelegate.DynamicInvokeImpl(Object[] args)
at System.Delegate.DynamicInvoke(Object[] args)
at Microsoft.AspNetCore.Components.EventCallbackWorkItem.InvokeAsync[Object](MulticastDelegate delegate, Object arg)
at Microsoft.AspNetCore.Components.EventCallback.InvokeAsync(Object arg)
at Microsoft.AspNetCore.Components.RenderTree.Renderer.DispatchEventAsync(UInt64 eventHandlerId, EventFieldInfo fieldInfo, EventArgs eventArgs, Boolean waitForQuiescence)
crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
Unhandled exception rendering component: Parameter count mismatch.
System.Reflection.TargetParameterCountException: Parameter count mismatch.
at System.Reflection.MethodBaseInvoker.ThrowTargetParameterCountException()
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at System.Delegate.DynamicInvokeImpl(Object[] args)
at System.MulticastDelegate.DynamicInvokeImpl(Object[] args)
at System.Delegate.DynamicInvoke(Object[] args)
at Microsoft.AspNetCore.Components.EventCallbackWorkItem.InvokeAsync[Object](MulticastDelegate delegate, Object arg)
at Microsoft.AspNetCore.Components.EventCallback.InvokeAsync(Object arg)
at Microsoft.AspNetCore.Components.RenderTree.Renderer.DispatchEventAsync(UInt64 eventHandlerId, EventFieldInfo fieldInfo, EventArgs eventArgs, Boolean waitForQuiescence)
14 replies
CC#
Created by DaClownie on 1/29/2025 in #help
Accessing the value contained within a record struct
At that point, I wouldn't need to make another copy of it to assessmentId, I could just use assessment.Id as I see fit?
16 replies
CC#
Created by DaClownie on 1/29/2025 in #help
Accessing the value contained within a record struct
?
16 replies
CC#
Created by DaClownie on 1/29/2025 in #help
Accessing the value contained within a record struct
so
if(ParentAssessment is {} assessment);
var assessmentId = assessment.Id;
if(ParentAssessment is {} assessment);
var assessmentId = assessment.Id;
16 replies
CC#
Created by DaClownie on 1/29/2025 in #help
Accessing the value contained within a record struct
Is it essentially creating a copy of it?
16 replies
CC#
Created by DaClownie on 1/29/2025 in #help
Accessing the value contained within a record struct
Also, that .HasValue feels like it would be a lot cleaner than always doing if (Id is not null) or some variation of that
16 replies
CC#
Created by DaClownie on 1/29/2025 in #help
Accessing the value contained within a record struct
I'll read up more on that link you sent. Thanks!
16 replies
CC#
Created by DaClownie on 1/29/2025 in #help
Accessing the value contained within a record struct
Fantastic, that was it
16 replies
CC#
Created by DaClownie on 1/29/2025 in #help
Accessing the value contained within a record struct
Give me a few and I'll report back
16 replies
CC#
Created by DaClownie on 1/29/2025 in #help
Accessing the value contained within a record struct
ohhhh, I kept trying to do that but in the wrong order. I was using ParentAssessment.Id.Value. Let me give that a try. I'm catching the null in another spot and shortened it to just show what i was having an issue with
16 replies
CC#
Created by DaClownie on 9/1/2024 in #help
Unable to get tabs to show after initial login screen for MAUI app
Oh I forgot, the mention, that janky "MainPage" link at the bottom of the first screenshot will actually navigate me back to the MainPage
2 replies
CC#
Created by DaClownie on 8/26/2024 in #help
✅ How to access specific fields from an [ObservableProperty] ObservableCollection<Object>?
forging along. If I get to the end and have time, i'll dig into the observable property on the collection issue, but not a big deal atm
227 replies