Ahoj. Mam dotaz ohledne spravneho uziti MarkupControlContainer
Dotvvm 4 last…
mam vlastni controlku
public class DynamicComponent : HtmlGenericControl ...
nabinduju do ni control propertu ControlName = cc:MyControl…
protected override void OnLoad(IDotvvmRequestContext context)
{....
var child = new MarkupControlContainer("cc:MyControl", c => {
c.SetValue(MyControl.NameProperty, someValue);
...
});
this.Children.Add(child);
base.OnLoad(context);
}
pekne vse vykresli, ale
do cc:MyControl pridam button s eventem Click a commandem controlky cc:MyControl…
neco jako:
<dot:LinkButton Click="{command: _control.DoAdd()}">ADD</dot:LinkButton>
samotna kontrolka funguje
pri vygenerovani pres MarkupControlContainer a klik na button ADD
skonci chybou… neco jako
Napada vas neco? Diky
{
“Error”: {
“FileName”: null, “Msg”: “Multiple controls with the same UniqueID ‘c246_c53_c9a0’ were found: \n * <dot: MarkupControlContainer /> from Views/App/Sandbox/DashboardDynamicTest.dothtml: 13\n * <: DashDokladLastUsed /> from C: \Workfiles\Web\TestApp.Dotvvm4\TestApp.App\Controls/Dashboard/DashboardModule\DashDokladLastUsed.dotcontrol", “RelatedProperty”: null, “RelatedBinding”: null, “RelatedResolvedControl”: null, “RelatedDothtmlNode”: null, “RelatedResource”: null, “RelatedControl”: {
“Control”: “MarkupControlContainer”, “Properties”: {
“Internal.UniqueID”: “c9a0”
}
, “LifecycleRequirements”:“PreInit, Init, Load, PreRender”
}
, “Location”:null, “Message”:"Multiple controls with the same UniqueID ‘c246_c53_c9a0’ were found:\n * <dot:MarkupControlContainer /> from Views/App/Sandbox/DashboardDynamicTest.dothtml:13\n * <:DashDokladLastUsed /> from C:\Workfiles\Web\TestApp.Dotvvm4\TestApp.App\Controls/Dashboard/DashboardModule\DashDokladLastUsed.dotcontrol”, “Data”: {
}
, “InnerException”:null, “HelpLink”:null, “Source”:“DotVVM.Framework”, “HResult”:-2146233088, “StackTrace”:" at DotVVM.Framework.Controls.DotvvmControl.FindControlByUniqueId(String controlUniqueId) in //src/Framework/Framework/Controls/DotvvmControl.cs:line 440\r\n at DotVVM.Framework.ViewModel.Serialization.DefaultViewModelSerializer.ResolveCommand(IDotvvmRequestContext context, DotvvmView view) in //src/Framework/Framework/ViewModel/Serialization/DefaultViewModelSerializer.cs:line 375\r\n at DotVVM.Framework.Hosting.DotvvmPresenter.ProcessRequestCore(IDotvvmRequestContext context) in /_/src/Framework/Framework/Hosting/DotvvmPresenter.cs:line 236"
}
, “TraceID”:“0HN6767JTVNC7:00000002”, “URL”:“http://localhost:34147/App/sandbox/dashboarddynamictest”, “StackTrace”:null, “LineNumber”:null, “FileName”:null, “Procedure”:null
}