Base: How to change ListBox SelectedValue via LO Basic

Trying to use LO Basic macro to change value of List Box in LO Base form. The ListBox is on a grid control on the form.

short problem: when I change the .SelectedValue = newvalue, it does not change the list. This operation does change the .currentvalue (can see this by printing), whch when queried on other lines with saved values, returns the list value. However, the form is not actually refreshing or recognizing the list position when I change it. I tried .refresh, but that did not seem to do anything.

to get started:

dim new_val
dim frm, ofForm, oControl
frm = ThisComponent.Drawpage.Forms
ofForm = frm.getByName("MyForm")
oControl = ofForm.GetByName("MainForm_Grid")

looking for the ListBox equivalent of :

oControl.GetByName("text1").text = new_val


oControl.GetByName("list1").SelectedValue = new_val

this sort of worked, because when I then

print oControl.GetByName("list1").currentvalue

it returns new_val, which suggests the operation was successful.

However, on the actual form, the new_val was not saved or displayed, remained blank, no effect.
May be a bug, or I may be missing something.

The SDK reference is here.

This is a bug for the grid. Filing bug report.

Needed to take second action in grid.


This might be best practice for other object types, but with grid list it only works this way.