Search code examples
gxt

Is it possible to add button on FormLayout


I need to display button in the middle of the dialog that uses FormLayout

However when I'm adding button to such dialog, it added near standard dialog buttons (OK/Cancel etc.). I do not need to add buton there, I do need to add button in the body of the dialog?

I guess my problem is similar to this one http://www.coderanch.com/t/496347/GWT/GXT-Button-near-text-field


Solution

  • AdapterField should be used to adapt Button

    from http://tutorialsjava.com/2009/08/22/no-border-around-form-in-ext-gwt/ :

    FormLayout in Ext-Gwt (GXT) When using a FormLayout/FormPanel you need to be aware of some specific properties for a Form Layout.

    1. On a FormLayout only widgets that extend Field are displayed. If you want to display a widget that does not extend Field, you first have to wrap it in AdapterField.

    2. When I used a FormPanel it had a border around the form even when setting .setFrame(false) and .setBorders(false) .

    This is not a bug, you also need to set .setBodyBorder(false) to see no borders around a form.