java - smartgwt - DynamicForm 相对列宽

标签 java gwt smartgwt

如果我创建如下所示的 DynamicForm,DynamicForm 的 FormItem 将放置在 2 行上。我原以为他们会排成一排。位置分布如下:第一列 20 px,第二列 250 px,其余第三列。

final DynamicForm df = new DynamicForm();
FormItem[] fi = new FormItem[3];
// filling the list with one CheckboxItem, one TextItem and one SelectItem
df.setColWidths("20", "250", "*");
df.setNumCols(3);
df.setFields(fi);

结果如下所示:

result screenshot

我想将所有 FormItem 放在一行中。

最佳答案

Basically title of form item also takes one column. If you do want to show the title also then it will double the column count.

有关更多信息,请查看 DynamicForm#setColWidths() .


根据您的评论:

//filling the list with one CheckboxItem, one TextItem and one SelectItem?

试试这个:

    final DynamicForm df = new DynamicForm();
    // FormItem[] fi = new FormItem[3];
    // filling the list with one CheckboxItem, one TextItem and one SelectItem

    CheckboxItem ci = new CheckboxItem();
    ci.setShowTitle(false);
    ci.setTitle("");

    TextItem ti = new TextItem();
    ti.setShowTitle(false);

    SelectItem si = new SelectItem();
    si.setShowTitle(false);
    si.setValues("PDF");

    df.setItems(ci, ti, si);

    df.setColWidths("20", "250", "*");
    df.setNumCols(3);
    // df.setFields(fi);

    RootPanel.get().add(df);

快照:

enter image description here


根据您的快照:

试试这个

    final DynamicForm df = new DynamicForm();
    // FormItem[] fi = new FormItem[3];

    CheckboxItem ci = new CheckboxItem();
    ci.setShowTitle(false);
    ci.setTitle("");

    SelectItem si = new SelectItem();
    si.setTitle("LANGUAGE");
    si.setValues("PDF");

    df.setItems(ci, si);

    df.setColWidths("20", "250", "*");
    df.setNumCols(3);
    // df.setFields(fi);

    RootPanel.get().add(df);

快照:

enter image description here

关于java - smartgwt - DynamicForm 相对列宽,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23201528/

相关文章:

java - GWT MVP 和 SmartGWT 兼容性

java - 将 TextView 动态添加到排行榜屏幕

web-applications - Roo + GWT - 适合开发?

java - 如何从智能 gwt 日历中删除下午/上午

java - 使用唯一键提取关联的 JSON 数据

java - 通过单击按钮从 servlet 下载图像 i GWT?

java - 在java中生成自定义文本文件

java - 需要在集成测试用例中模拟bean

java - JButtons 鼠标事件

java - MGWT [错误] 尝试接收未知事件类型 webkitAnimationEnd