Search code examples
canvasuser-inputtextfieldsmartgwt

How do I make TextItem into a center in DynamicForm?


I am using smartgwt and I want to add a TextItem to the Center of a DynamicForm.

This DynamicForm enables Resizing, so the TextItem should always be in it's center. Can anybody help me?

thanks, jogi.


Solution

  • A FormItem has a lot methods to control its visualization.

    Interesting for you should be:

    I.e. If you want to place a FormItem in the center of a DynamicForm-Row you should:

    1. set the ColSpan of the FormItem to the amount of columns of the DynamicForm
    2. set the Alignment to Alignment.CENTER

    Please note that you could use the method DynamicForm.setCellBorder(1) to debug the visualization of your DynamicForm