JavaScript UI Libraries & Blazor Components Suite – Smart UI Forums ListBox Set the selected values/index programmatically as an embedded component Reply To: Set the selected values/index programmatically as an embedded component

#102588
TurricanDE
Participant

I don’t think it is a dependency problem. I use the current Smart.Blazor 10.2.2.

As I mentioned, if the ListBox is outside the Window component the selection works like that:

<h3>ChildComponent</h3>

<ListBox DataSource=”@myData” SelectedValues=”@selectedValues” Editable=true>
</ListBox> // Selection works!

<Window IsOpened=”@OpenDialog” Label=”Test” Modal=true HeaderButtons=”@headerButtons” OnClose=”Closed”>
<ListBox DataSource=”@myData” SelectedValues=”@selectedValues” Editable=true>
</ListBox> // Selection not working!
</Window>

The “outside” listbox renders (Item 2 and 3)

<smart-list-item blazor-state-mode=”none” smart-blazor=”” id=”Smart0HMDEDNV87HFN” class=”smart-element smart-list-item” _bl_703cf334-ed07-4727-84a1-38adbe515b0e=”” value=”2″ label=”2″ role=”option” <span style=”text-decoration: underline;”>selected=”” aria-selected=”true”</span>>

<smart-list-item blazor-state-mode=”none” smart-blazor=”” id=”Smart0HMDEDNV87HFO” class=”smart-element smart-list-item” _bl_c2bb693a-fb93-447a-bed9-fd54d7765e4a=”” value=”3″ label=”3″ role=”option” focus=””<span style=”text-decoration: underline;”> selected=”” aria-selected=”true”</span>>

But the Listbox inside the Window component renders:

<smart-list-item blazor-state-mode=”none” smart-blazor=”” id=”Smart0HMDEDNV87HG5″ class=”smart-element smart-list-item” _bl_8e88a510-7f47-4889-9811-dae64596f970=”” value=”2″ label=”2″ role=”option” <span style=”text-decoration: underline;”>aria-selected=”false”</span>>

<smart-list-item blazor-state-mode=”none” smart-blazor=”” id=”Smart0HMDEDNV87HG6″ class=”smart-element smart-list-item” _bl_f8b55511-a6b5-4600-962a-75390155e7b6=”” value=”3″ label=”3″ role=”option” focus=”” <span style=”text-decoration: underline;”>aria-selected=”false”</span>>

How could that be? There is no additional logic in the component, I posted the full example above (ParentComponent/ChildComponent)

I have no idea…