Announcement

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

    v15.1d Setting width="*" on TextItem shrinks FilterBuilder value field

    Hi,
    We have noticed that when we changed SGWT library from v13.0p_2022-10-26 to v15.0d_2026-03-15 our FilterBuilder based forms started to shrink text values like this:
    Click image for larger version  Name:	FB_valueField_shrink.png Views:	0 Size:	4.8 KB ID:	277434
    It turned out that we are using TextItem with width attribute set to "*" and that is causing shrinking value when new lib is used.

    Here is test case to demonstrate:
    Code:
    import com.google.gwt.core.client.EntryPoint;
    import com.smartgwt.client.data.DataSource;
    import com.smartgwt.client.data.DataSourceField;
    import com.smartgwt.client.data.fields.DataSourceTextField;
    import com.smartgwt.client.types.FieldType;
    import com.smartgwt.client.widgets.form.FilterBuilder;
    import com.smartgwt.client.widgets.form.fields.TextItem;
    
    public class MainEntryPoint implements EntryPoint {
    
        public void onModuleLoad() {
    
            layout();
        }
    
        private void layout() {
    
            DataSource testDS = new DataSource();
    
            DataSourceField idField = new DataSourceField();
            idField.setType(FieldType.SEQUENCE);
            idField.setName("id");
            idField.setPrimaryKey(true);
            idField.setHidden(true);
            DataSourceTextField codeField = new DataSourceTextField();
            codeField.setName("code");
            TextItem textItemProperties = new TextItem();
            textItemProperties.setWidth("*");//!
            codeField.setEditorProperties(textItemProperties);
    
            testDS.setFields(idField, codeField);
    
            FilterBuilder fb = new FilterBuilder();
            fb.setDataSource(testDS);
    
            fb.draw();
        }
    
    }
    The same code with line textItemProperties.setWidth("*"); commented out (or compiled with v13 lib) shows:
    Click image for larger version  Name:	FB_valueField_no_shrink.png Views:	0 Size:	6.3 KB ID:	277435
    Thanks,
    MichalG

    #2
    The "problem" is that previously there was a bug where your setting was ignored, and we fixed it, now you're seeing correct behavior.

    You can fix this by simply removing that setting. Or you could set the overall FilterBuilder's width wide enough so that width:"*" won't be forced down to the minimum width (because that's why it's smaller).

    Comment

    Working...
    X