Created attachment 111543 [details] source file in which a dialog with tab pages is created When creating a UNO dialog in Java (using Libreoffice SDK 4.2.7.2 coded using the Netbeans Openoffice plugin 4.0.6) adding tab pages to a dialog does not work. I am adding tab pages by creating a UnoControlTabPageContainerModel, querying its interface and subsequently adding individual tab pages to it by using the function createTabPage(). However, in Libreoffice it merely shows a dialog window without tab pages. However, the same code reportedly works in Openoffice (see user Hanya in https://forum.openoffice.org/en/forum/viewtopic.php?f=44&t=74391&p=336538#p336538) and produces a functional dialog with tab pages. The important part of the code (full code is attached below): Object oDialogProvider =m_xMCF.createInstanceWithContext("com.sun.star.awt.DialogProvider", m_xContext); XDialogProvider xDialogProvider = UnoRuntime.queryInterface(XDialogProvider.class, oDialogProvider); XDialog xDialog = xDialogProvider.createDialog("vnd.sun.star.script:Standard.Dialog1?location=application"); if (xDialog == null) return; XControlModel xDialogModel = UnoRuntime.queryInterface(XControl.class, xDialog).getModel(); XMultiServiceFactory xMsf = UnoRuntime.queryInterface(XMultiServiceFactory.class, xDialogModel); XNameContainer xNameContainer = UnoRuntime.queryInterface(XNameContainer.class, xDialogModel); Object tabPagesModel = xMsf.createInstance("com.sun.star.awt.tab.UnoControlTabPageContainerModel"); xNameContainer.insertByName("tab", tabPagesModel); XPropertySet xPropSet = UnoRuntime.queryInterface(XPropertySet.class, tabPagesModel); xPropSet.setPropertyValue("Width", 100); xPropSet.setPropertyValue("Height", 100); XTabPageContainerModel xTabPagesModel = UnoRuntime.queryInterface(XTabPageContainerModel.class, tabPagesModel); XTabPageModel xTabPageModel1 = xTabPagesModel.createTabPage((short) 1); xTabPageModel1.setTitle("Page 1"); xTabPagesModel.insertByIndex(0, xTabPageModel1); XTabPageModel xTabPageModel2 = xTabPagesModel.createTabPage((short) 2); xTabPageModel2.setTitle("Page 2"); xTabPagesModel.insertByIndex(1, xTabPageModel2);
Created attachment 111544 [details] screenshot of the resulting dialog
Stephan: one for you?
Providing an obvious main() for attachment 111543 [details] and connecting it to a LO instance makes it fail with an IllegalArgumentException from xDialogProvider.createDialog(). Please provide sources for a complete yet as-minimal-as-possible reproducer.
Created attachment 114601 [details] Basic script to create a tabpage Here is a Basic script to create a very simple tabpage. This code works in AOO 4.1.1 In LO 4.4.2, it raises an exception com.sun.star.beans.UnknownPropertyException at line: tabPageModel.insertByName("intab",fixedTextModel)
** Please read this message in its entirety before responding ** To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year. There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present. If you have time, please do the following: Test to see if the bug is still present on a currently supported version of LibreOffice (5.0.5 or 5.1.2 https://www.libreoffice.org/download/ If the bug is present, please leave a comment that includes the version of LibreOffice and your operating system, and any changes you see in the bug behavior If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a short comment that includes your version of LibreOffice and Operating System Please DO NOT - Update the version field - Reply via email (please reply directly on the bug tracker) - Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not appropriate in this case) If you want to do more to help you can test to see if your issue is a REGRESSION. To do so: 1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) http://downloadarchive.documentfoundation.org/libreoffice/old/ 2. Test your bug 3. Leave a comment with your results. 4a. If the bug was present with 3.3 - set version to "inherited from OOo"; 4b. If the bug was not present in 3.3 - add "regression" to keyword Feel free to come ask questions or to say hello in our QA chat: http://webchat.freenode.net/?channels=libreoffice-qa Thank you for your help! -- The LibreOffice QA Team This NEW Message was generated on: 2016-04-16
** Please read this message in its entirety before responding ** To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year. There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present. If you have time, please do the following: Test to see if the bug is still present on a currently supported version of LibreOffice (5.2.7 or 5.3.3 https://www.libreoffice.org/download/ If the bug is present, please leave a comment that includes the version of LibreOffice and your operating system, and any changes you see in the bug behavior If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a short comment that includes your version of LibreOffice and Operating System Please DO NOT Update the version field Reply via email (please reply directly on the bug tracker) Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not appropriate in this case) If you want to do more to help you can test to see if your issue is a REGRESSION. To do so: 1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) http://downloadarchive.documentfoundation.org/libreoffice/old/ 2. Test your bug 3. Leave a comment with your results. 4a. If the bug was present with 3.3 - set version to "inherited from OOo"; 4b. If the bug was not present in 3.3 - add "regression" to keyword Feel free to come ask questions or to say hello in our QA chat: http://webchat.freenode.net/?channels=libreoffice-qa Thank you for helping us make LibreOffice even better for everyone! Warm Regards, QA Team MassPing-UntouchedBug-20170522
It is still not working with LO 5.3, Windows 10 Version: 5.3.1.2 (x64) Build-ID: e80a0e0fd1875e1696614d24c32df0f95f03deb2 CPU-Threads: 8; BS-Version: Windows 6.19; UI-Render: Standard; Layout-Engine: neu; Gebietsschema: de-DE (de_DE); Calc: group Same error: com.sun.star.beans.UnknownPropertyException
LO 5.3.0.3 under Linux openSUSE LEAP 42.2: the same bug as with Windows. If I try to insert the button controls directly into the tab pages, I don't get an error, but no buttons inside as well. Most likely it's all the same internally. In short: oTabPage1 = CreateUnoService("com.sun.star.awt.tab.UnoControlTabPage") oTabPage1.setModel(oTabPageModel1) oButton1 = CreateUnoService("com.sun.star.awt.UnoControlButton") oButton1.setModel(oButtonModel1) oTabPage1.addControl("Tab 1", oButton1) It's a pity.
I was wrong. This is the part of my code showing one tab page (of two), with one button control within: oTabContainerModel = oDialogModel.CreateInstance("com.sun.star.awt.tab.UnoControlTabPageContainerModel") With oTabContainerModel .Name = "Tab" .PositionX = 6 .PositionY = 10 .Width = 145 .Height = 100 .TabIndex = 2 .Border = 1 .BackgroundColor = RGB(255, 255, 255) End With oDialogModel.insertByName("tab", oTabContainerModel) oTabPage1 = CreateUnoService("com.sun.star.awt.tab.UnoControlTabPage") args = Array(1) oTabPageModel1 = oDialogModel.createInstance("com.sun.star.awt.tab.UnoControlTabPageModel") oTabPageModel1.initialize(args) oTabPageModel1.Title = "Page 1" oTabPageModel1.Name = "Tab1" oTabPage1.setModel(oTabPageModel1) oTabContainerModel.insertByIndex(0, oTabPageModel1) oButton1 = CreateUnoService("com.sun.star.awt.UnoControlButton") oButtonModel1 = oTabPageModel1.createInstance("com.sun.star.awt.UnoControlButtonModel") With oButtonModel1 .PositionX = 10 .PositionY = 10 .Width = 30 .Height = 15 .Label = "Button 1" End With oButton1.setModel(oButtonModel1) oTabPage1.addControl("Tab 1", oButton1) Print oTabPage1.Controls(0).Model.Label ' shows "Button 1" The tab pages are displayed, but not the buttons, even though they are there in the tab pages.
Hi Thomas, Could you please try what Volker is suggesting? I have set the bug's status to 'NEEDINFO'. Please change it back to 'UNCONFIRMED' once you have retested
hey Xisco, it is still not working;) Thats even what Volker mentioned. He still use the Basic-Script (attachement 3) , but changed some contents. His additional codes just show, that all internal models works correct (i.e. his Tab-page label), properties are stored correct, but trying to get it work in a real dialog fails... nothing will be displayed. result ist equal to sreenshot attatchment 2. So: API is broken of using tabs (mainly display) - never mind if code is Java or basic. so, bug is still open.
Problem also occurs in Basic, Python. Changing title Basic/Java/Python. The script provided by Olivier throw an UnknownPropertyException.
Created attachment 148520 [details] Basic tabs with button and text on the 2nd Took some time to figure this "workaround" out. AFAIK com.sun.star.awt.tab.UnoControlTabPageContainerModel currently just works for AOO, but com.sun.star.awt.UnoMultiPageModel does for LO. Probably some conversation between these models is missing? I didn't check that. I actually didn't try the other examples and copied code from various forum and wiki and blog posts, even some LO ask. None of the stuff I found still worked out of the box, which means there is definitely stuff broken :-( Xray told me some interface and function existed, but Basic complained about it, when trying to set the tabs properties via XSimpleTabController. I just tested this Basic script on Linux, but I guess it will also work on other platform.
Some remarks to the workaround. You can create a page model from the tabs container model as well as from the dialog model: pageModel1 = dialogModel.CreateInstance("com.sun.star.awt.UnoPageModel") instead of pageModel1 = tabsModel.CreateInstance("com.sun.star.awt.UnoPageModel") It seems that the tabs container model inherits from the dialog model. The next one has a practical relevance. You may want to use the page model's TabPageID property. If you create the page model with CreateInstance, the TabPageID's value is zero for each created page. Nevertheless you can put the focus to a page (e.g. the first one) with dialog.getControl("tab").activateTab(1) But there is no effect, if you try it with dialog.getControl("tab").activateTab(pageModel2.TabPageID) It is always the first page. So you'd better create the pages with createInstanceWithArguments and supply the IDs: pageModel1 = tabsModel.createInstanceWithArguments _ ("com.sun.star.awt.UnoPageModel", Array(1)) pageModel2 = tabsModel.createInstanceWithArguments _ ("com.sun.star.awt.UnoPageModel", Array(2)) Now you can use the pages' TabPageIDs, but you cannot write to them. This property is read only. The following will succeed: dialog.getControl("tab").activateTab(pageModel2.TabPageID).
Vasily Melenchuk committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/+/3deab788199395712b7d4641be5b11623b2ed964%5E%21 tdf#87884: basic: fix for UnknownPropertyException It will be available in 6.3.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Vasily Melenchuk committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/+/18f2e73f51c0f09c94f1a2b701d8e064adb39bf5%5E%21 tdf#87884: UnoControlTabPageModel is using tabs w/o WB_NOBORDER It will be available in 6.3.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Vasily Melenchuk committed a patch related to this issue. It has been pushed to "libreoffice-6-1": https://git.libreoffice.org/core/+/aa7b71cd17898cd47f4bd7f12cfe5036cd40cb57%5E%21 tdf#87884: basic: fix for UnknownPropertyException It will be available in 6.1.6. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Vasily Melenchuk committed a patch related to this issue. It has been pushed to "libreoffice-6-2": https://git.libreoffice.org/core/+/954c23f3393fc1d6e06687db8718f072723c8355%5E%21 tdf#87884: basic: fix for UnknownPropertyException It will be available in 6.2.1. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Vasily Melenchuk committed a patch related to this issue. It has been pushed to "libreoffice-6-2": https://git.libreoffice.org/core/+/bc08bef01363537eac91daacc37529326d26a2b6%5E%21 tdf#87884: UnoControlTabPageModel is using tabs w/o WB_NOBORDER It will be available in 6.2.1. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Vasily Melenchuk committed a patch related to this issue. It has been pushed to "libreoffice-6-1": https://git.libreoffice.org/core/+/08aa78cc52ea49fea2454096e97875f1d4b4cecc%5E%21 tdf#87884: UnoControlTabPageModel is using tabs w/o WB_NOBORDER It will be available in 6.1.6. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.