Indent when recursively embedding DynamicForms

I am seeing an indent issue when embedding a DynamicForm in a DynamicForm using a CanvasItem. The following contrived example shows the issue:

public class DynamicFormItem extends CanvasItem {
    private VLayout vlayout = new VLayout();

    public DynamicFormItem() {
        setTitle(""); // otherwise will see text isc_OID_## :
        setCanvas(vlayout);
    }

    public void addForm(DynamicForm DynamicForm) {
        vlayout.addMember(dynamicForm);
    }
};

DynamicForm form1 = new DynamicForm();
form1.setNumCols(4);

TextItem firstItem = new TextItem("first");
TextItem secondItem = new TextItem("second");
TextItem thirdItem = new TextItem("third");

Now in Case 1, the 3 formItems are added to the form:

form1.setFields(firstItem, secondItem, thirdItem);

The thirdItem aligns as expected with firstItem.

In case 2, thirdItem is embedded in a DynamicForm first:

DynamicForm form2 = new DynamicForm();
form2.setColSpan(form1.getNumCols())
form2.setFields(thirdItem);

DynamicFormItem formItem = new DynamicFormItem();
formItem.addForm(form2)

form1.setFields(firstItem, secondItem, formItem);

thirdItem is indented first (by one cell?) and does not align with firstItem.

In one usage of mine a having this indent works great but in another it throws things off. Any thoughts on what is causing the indent and if it can be adjusted?

Thanks, Tom.

See the FormLayout overview that various layout-related properties link to.

Why the condescending reply? None would be better :slight_smile: I spent many hours working on this including reading all the documentation and playing with different options prior to posting.

If anyone can provide any non-treasure-hunt insight it would be much appreciated.

This is the overview we’re referring to. You probably have not read this as it was recently added.

Huge discovery: Developer Console!

I worked with the info on that page again for an hour after reading your previous post and replying last. I tried to debug with getCellBorder() but it caused an AV for me. I tried doing a setWidth(“*”) for the canvasItem I am embedding the DynamicForm on, but that did not help.

Rereading the page again now…ah the developer console, first I have heard of that, sounds very useful. How to get
http://www.smartclient.com/smartgwt/showcase/sc/system/helpers/Log.html
working? Via the thread http://forums.smartclient.com/showthread.php?t=3033 I added this code to my entry point onModuleLoad:

        if (!GWT.isScript()) {
            KeyIdentifier debugKey = new KeyIdentifier();
            debugKey.setCtrlKey(true);
            debugKey.setKeyName("D");

            Page.registerKey(debugKey, new KeyCallback() {
                public void execute(String keyName) {
                    SC.showConsole();
                }
            });
        }

Now Ctrl+D brings ups the console in hosted mode! Looks very useful. Under Logging Preferences | More, I added the page level logging priority tablePlacement, to give:

Global Log Priorities updated: Modified categories: {
    tablePlacement:4
}

I have not been able yet to discover why the indent space is added…

The SSCCE provided in the OP reproduces the issue with the indentation. Can anyone suggest how I can remove this indent?