Search code examples
gwtuibinder

Is it possible to set the column width of a grid in GWT using uibinder?


I'm trying to use the GWT grid component in uibinder. It works fine until I want to set the width of the columns. The following is what I've tried to do but it doesn't seem to work.

        <g:Grid width="100%">
        <g:row>
            <g:customCell width="20%">
                <g:FlowPanel width="">
                </g:FlowPanel>
            </g:customCell>
            <g:customCell width="80%">
                <g:FlowPanel width="">
                </g:FlowPanel>
            </g:customCell>
        </g:row>
    </g:Grid>

Solution

  • Only styleName is taken into account on g:row, g:cell and g:customCell elements.

    If you can (i.e. if your grid content is mostly static), avoid using Grid and prefer an HTMLPanel containing an HTML <table>, this gives you much more flexibility.

    http://code.google.com/p/google-web-toolkit/source/browse/tags/2.4.0/user/src/com/google/gwt/uibinder/elementparsers/GridParser.java