Quantcast
Channel: SmartClient Forums
Viewing all articles
Browse latest Browse all 4756

FilterBuilder renders 2 char length value field for item width=*

$
0
0
1. 5.0p SmartClient Version: v9.1p_2014-10-03/LGPL Development Only (built 2014-10-03)
Tested against 4.1p, too.

2. FF 24.5.0 on Gentoo Linux

3.

4.

5.

6. sample code
Code:

package pl.com.tech4.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.DOM;
import com.smartgwt.client.data.DataSource;
import com.smartgwt.client.data.fields.DataSourceTextField;
import com.smartgwt.client.util.SC;
import com.smartgwt.client.widgets.form.DynamicForm;
import com.smartgwt.client.widgets.form.FilterBuilder;
import com.smartgwt.client.widgets.form.fields.FormItem;
import com.smartgwt.client.widgets.layout.VLayout;

public class MainEntryPoint implements EntryPoint {
 
    public void onModuleLoad() {

        DOM.getElementById("loadingPicture").removeFromParent();
        layout();
        SC.showConsole();
    }
 
    private void layout() {

        DataSource ds = new DataSource();
        DataSourceTextField descriptionField = new DataSourceTextField();
        descriptionField.setName("description");
        FormItem descriptionItemProperties = new FormItem("description");
        descriptionItemProperties.setWidth("*");
        descriptionField.setEditorProperties(descriptionItemProperties);
        ds.setFields(descriptionField);

        DynamicForm form = new DynamicForm();
        form.setWidth(500);
        form.setDataSource(ds);
     
        FilterBuilder filter = new FilterBuilder();
        filter.setWidth(500);
        filter.setDataSource(ds);
     
        VLayout layout = new VLayout();
        layout.addMember(form);
        layout.addMember(filter);
        layout.draw();
    }
 
}

There is a datasource text field "description". This field has editorProperties set to form item, which has width set to "*". This is commonly used to have description field use all available form space (as on attached picture).
There is a problem with the FilterBuilder binded to the same datasource. In this case, description field is rendered with width which allows to show/edit only 2 characters at a time (as on attached picture).
MichalG

Attached Images
File Type: png fbfield.png (12.4 KB)

Viewing all articles
Browse latest Browse all 4756

Trending Articles