I have a OO-Base form under Linux with data bound controls (to reproduce create a simple table with Base and use the wizard to create the form).
I have manually added a combobox (not bound to a table column) and I want to change the data in one of the bound controls depending on data
selected in that combobox. (Basic sample attached) This works so far. But when I go to the next record and then back I can see that the data in
the bound control was not saved. Also when I change the bound control via the combobox I can see that the record is not marked as modified (the
"save record" symbol is disabled). This is not the case when I change the data in the bound control directly.
The docs say that you have to "actively commit" ?!?
> http://wiki.services.openoffice.org/wik ... g_Controls
I'm trying now for hours, but the API docs are somewhat confusing (at least for the unexpirienced user like me) (as my head is now )
Code: Select all
Sub performedWhenComboBoxChanges
dim doc as object
dim form as object
dim ctl_cb as object
dim ctl_tf as object
doc = stardesktop.currentcomponent
form = doc.drawpage.forms(0)
ctl_cb = form.getbyname("ComboBox")
ctl_tf = form.getbyname("TextField")
if ctl_cb.text="foo" then
ctl_tf.text="0"
elseif ctl_cb.text="bar" then
ctl_tf.text="1"
end if
rem with this the "save record" is activated but OO crashes
rem form.setPropertyValue("IsModified", True)
rem this doesnt work either
rem ctl_tf.commit()
End Sub