Is there a list of methods for form fields?

I have several macros associated with buttons that do things on a form. I also have a “Save” button defined. If the update field buttons are clicked the form does not detect something has changed and the form “Save” button does not enable. The field shows the new value, and it’s saved if I use the built in save record icon. So, there must be a comprehensive list somewhere, that I haven’t found, of all the different methods for form objects. I experimentally tacked on a commit() to the end of the field object statement in the macro, and that did save the update, but I’d rather just mark a field as updated and then have the system enable the save button. The IDE doesn’t have an autocomplete feature for objects so I don’t want to sit and guess the syntax, and maybe there isn’t even a method.

Sub UpdateField
  ThisComponent.Drawpage.Forms.getByName("MainForm").getByName("MyTextField").Text = "bla"
  ThisComponent.Drawpage.Forms.getByName("MainForm").getByName("SaveUpdates").enabled
End Sub

So the above macro routine puts “bla” into the field “MyTextField”. This works fine. But the form has a defined “SaveUpdates” button that saves the record. Unfortunately that button is not enabled when the “MyTextField” is updated by the previous statement, even though the form shows the new “bla” value. So there must be a way to mark the field (MyTextField) on the form (MainForm) as having been changed so the form handler enables the “SaveUpdates” button.

If I manually change the field (MyTextField) the form handler does enable the button.
The next second statement is trying to enable the “SaveUpdates” button, but I really don’t care if the way to do it is mark the text field as modified, or mark the submit button as enabled or mark the form as having been modified.

I’ve looked at lots of documentation, and will continue to look and try and learn about the what LibreOffice macros and the document model works, but in the short term can anyone provide a quicker solution?

Hello,

No, there is no “comprehensive list somewhere”.

Aside from the documents already given in the last post, there are more in this post → To learn LibreOffice Base are there introductions or tutorials?

The Apache OpenOffice Developer’s Guide has a lot to offer and you will find an ‘UNO Object Inspection Tool’ (under USEFUL EXTENSIONS) a must in dealing with macros.

Edit:

For MRI (introspection tool) the mos recent links can be found at the end of my answer here → Elements for GetRegistryKeyContent(“org.openoffice.Setup/Product”)

Edit #2:

Another source → reference documentation for the UNO IDL API

Edit 2020-03-19:

Please, when changing the question please note where the edit occurs.

You have already discovered the commit() method. This is probably the easiest since you are already moving data into the control. You can also update by obtaining the Column from the Form.

For example of each of these solutions see answers in this post → SAVE isn’t saving the updated field (Macro Issue)

Thx. I’ll note the edits next time…still learning this forum and the OpenOffice environment, obviously. the again, for feedback is very help to me…

@MadMacks,

This is LibreOffice site :slight_smile:

Also, as with all questions, if this answers your question please tick the :heavy_check_mark: (upper left area of answer). It helps others to know there was an accepted answer.

@MadMacks,

Please note it is not necessary to actually Close questions as you have. It would simply be helpful to others if there is an accepted answer.