Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    RichTextEditor.setHeight("*"); bug

    I have the following code in which RichTextEditor.setHeight("*") does not work correctly;
    Will this bug be fixed?

    Code:
    public class TestBug implements EntryPoint {
        public void onModuleLoad() {
            HTMLEditor editor = new HTMLEditor();
            editor.setWidth("70%");
            editor.setHeight("70%");
            editor.init();
            editor.draw();
        }
        class HTMLEditor extends Window {
            public HTMLEditor () {
    
            }
            public void init() {
                setTitle("editProperty");
                setRedrawOnResize(true);
                setShowMinimizeButton(false);
                setIsModal(true);
                setShowModalMask(true);
                setKeepInParentRect(true);
                addCloseClickHandler(new CloseClickHandler() {
                    public void onCloseClick(CloseClickEvent event) {
                        destroy();
                    }
                });
    
                Button cancelButton = new Button("cancel");
                Button saveButton = new Button("save");
    
                HLayout hLayout = new HLayout(5);
                hLayout.setAlign(Alignment.RIGHT);
                hLayout.setAutoHeight();
                hLayout.addMembers(cancelButton, saveButton);
    
                RichTextEditor textEditor = new RichTextEditor();
                textEditor.setWidth("100%");
                textEditor.setHeight("*");
                textEditor.setControlGroups(new Object[]{StandardControlGroup.FONTCONTROLS, StandardControlGroup.STYLECONTROLS, StandardControlGroup.FORMATCONTROLS, StandardControlGroup.COLORCONTROLS, StandardControlGroup.BULLETCONTROLS});
    
    
                addItem(textEditor);
                addItem(new LayoutSpacer(1, 5));
                addItem(hLayout);
                addItem(new LayoutSpacer(1, 5));
                show();
                centerInPage();
    
            }
        }
    }
    Click image for larger version  Name:	Zwischenablage-0.jpg Views:	0 Size:	23.0 KB ID:	268864
    Last edited by Hirn; 19 Oct 2022, 01:33.

    #2
    It looks like you may be confused between RichTextEditor (a Canvas subclass) and RichTextItem (a FormItem subclass). You are trying setHeight("*") which is only valid for RichTextItem. Use setHeight("100%") instead.

    Note this is reported in your Developer Console - be sure to keep an eye on this.

    Comment

    Working...
    X