Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The displayed item in the listbox is set by the index # of the item in the VIEW of the control.

oField1 = oForm1.getByName("Your FieldName")
Doc = ThisComponent
DocCtl = Doc.getCurrentController()
'Get VIEW for listbox
CtlView = DocCtl.GetControl(oField1)
CtlView.selectItemPos(IndexValueHere, True)

When a form is first opened, the control is sitting at index 0 (the first item in the list).