PDA

View Full Version : DualListField/FormData height setting not working



cri1258
9 Sep 2009, 8:53 AM
I'm trying to get the height of a DualListField to expand vertically to take up the maximum space. It's not working. Wonder what I might be doing wrong. Any help much appreciated.


package com.centurylink.testgwtgxt.client;

import com.extjs.gxt.ui.client.data.BeanModel;
import com.extjs.gxt.ui.client.store.ListStore;
import com.extjs.gxt.ui.client.store.StoreSorter;
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.Viewport;
import com.extjs.gxt.ui.client.widget.form.DualListField;
import com.extjs.gxt.ui.client.widget.form.FormPanel;
import com.extjs.gxt.ui.client.widget.form.ListField;
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.extjs.gxt.ui.client.widget.layout.FormData;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.Element;
import com.google.gwt.user.client.ui.RootPanel;

public class TestGwtGxt implements EntryPoint {

public void onModuleLoad() {
try {
Viewport viewport = new Viewport();
viewport.setLayout(new FitLayout());
DualListFieldExample dualList = new DualListFieldExample();
viewport.add(dualList);
RootPanel.get().add(viewport);
} catch (Throwable ex){
ex.printStackTrace();
}
}

class DualListFieldExample extends LayoutContainer {

@Override
protected void onRender(Element parent, int index) {
super.onRender(parent, index);
setStyleAttribute("margin", "10px");

FormPanel panel = new FormPanel();
panel.setSize(500, 400);
panel.setHeading("Drag and Drop Lists");

final DualListField<BeanModel> lists = new DualListField<BeanModel>();

lists.setFieldLabel("BeanModels");

ListField<BeanModel> from = lists.getFromList();
from.setDisplayField("name");
ListStore<BeanModel> store = new ListStore<BeanModel>();
store.setStoreSorter(new StoreSorter<BeanModel>());
from.setStore(store);
ListField<BeanModel> to = lists.getToList();
to.setDisplayField("name");
store = new ListStore<BeanModel>();
store.setStoreSorter(new StoreSorter<BeanModel>());
to.setStore(store);

panel.add(lists, new FormData("100% 100%"));
panel.setWidth(550);

add(panel);

}

}
}

JenMandy
23 Sep 2009, 9:01 AM
Have you been able to figure this out? I'm having the same issue and can't seem to get the list to re size. I'd like to make my 'to' and 'from' listfields tall enough so there isn't a need to have a vertical scroll bar.

cri1258
24 Sep 2009, 9:08 AM
Nope. Never did figure it out. My guess is that its a bug. You might post a bug report....

msauter
3 Nov 2009, 5:42 AM
Is there any solution available now (workaround, bugfix) ?

chandankumarbv
17 Dec 2009, 9:29 PM
hi,
i'm also facing the same issue, i'm not able to expand the dual list field beyond its default size.
Also if the entries in the dual list field are long , then instead of showing horizontal scroll bar, the duallistfield expands and goes out of the panel in IE but works correctly in firefox.

any help is appreciated,

-Regards,
Chandan.