Hello everyone,
A form, which is visible in form navigator is of “com.sun.star.comp.forms.ODatabaseForm” type/service. Yet I looked it up in both, Libreoffice and Apache OO API reference, and I cannot find any information pertaining to it. But after looking up the Forms service, and finding the insertByName method inherited from XNameContainer interface, the only way that I found to create that form programmatically would be by the following code:
oForm = createUnoService(“com.sun.star.comp.forms.ODatabaseForm”)
ThisComponent.Sheets(0).DrawPage.Forms.InsertByName(“FormName”, oForm)
Questions that I’d like to ask are:
-
Why isn’t this service listed in the API Reference? I understand that the form gets automatically added when creating a new control, such as a button. But through my learning process I just wanted to understand the methodology behind this. I went through all three of Mr. Pitonyak’s books and did not find anything pertaining to it. The only mention which I found of this service was in ch. 9 of LibreOffice Base Handbook. But even that did not answer my question.
-
This has to do with the semantics of methods definition in the API Reference. When I looked up the insertByName function, it’s definition shows two parameters. First the name of the form to be created in a string format, and second is "[in] any aElement ". In all honesty, it’s completely by fluke that I actually figured it out and created the oForm object, and defined it as ODatabaseForm. Some of those parameter definitions are truly incoherent to a layman like myself. I’d like to ask if there is any literature to which I could refer to get a better understanding of how to read those definitions? Or is it just a matter of practice and experience?
Thank you in advance for any suggestions.