PDA

View Full Version : combobox problems



kolli
30 Mar 2009, 4:12 AM
hye guys,
I know this question has been asked a lot many times. I was searching for it but couldnot find an answer

why is my trigger and my listbox missaligned from the textbox.

I am adding this combobox into a fieldset with a table layout.

I am using gxt 1.2.3 and gwt 1.5.3

micgala
30 Mar 2009, 5:24 AM
Hi.

When you use GWT project generator, it creates some entries in the .css file that may cause problems with some libraries, ext-js is one of then... but I guess it could affect gxt also.

Are you sure you don't have any problematic entry in your css?

kolli
30 Mar 2009, 5:50 AM
Thanks for the reply,
i tried removing all the entries in the gwt project created CSS but couldnot find any difference in the combobox display.

sven
30 Mar 2009, 5:54 AM
I guess this is IE only right? IE has bad problems with positioning in table elements ;)

Post your code and i can try to give you some workarounds.

fother
30 Mar 2009, 6:13 AM
using table to generate the list in combobox?

is a bad design layout..

kolli
30 Mar 2009, 6:21 AM
This is an example of what I am doing.
I am adding a fieldset into a contentpanel.
this fieldset has a tablelayout and contains 2 simpleComboboxes.



package com.peoplenet.Test.client;

import com.extjs.gxt.ui.client.Style.HorizontalAlignment;
import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.form.FieldSet;
import com.extjs.gxt.ui.client.widget.form.LabelField;
import com.extjs.gxt.ui.client.widget.form.SimpleComboBox;
import com.extjs.gxt.ui.client.widget.layout.TableData;
import com.extjs.gxt.ui.client.widget.layout.TableLayout;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.RootPanel;
/**
* Entry point classes define <code>onModuleLoad()</code>.
*/
public class Test implements EntryPoint {

private SimpleComboBox<String> deptComboBox1;
private SimpleComboBox<String> jobCode1;
private FieldSet fieldSet;

public void onModuleLoad() {
ContentPanel c = new ContentPanel();

fieldSet = new FieldSet();
fieldSet.setWidth(550);
fieldSet.setBorders(false);
fieldSet.setLayout(new TableLayout(2));

setHeadings();

TableData td = new TableData();
td.setWidth("160px");
td.setHorizontalAlign(HorizontalAlignment.CENTER);

deptComboBox1 = new SimpleComboBox<String>();
deptComboBox1.add("Design");
deptComboBox1.add("Cleaning");
deptComboBox1.add("Wiring");
deptComboBox1.add("Health");
deptComboBox1.setWidth(140);
fieldSet.add(deptComboBox1,td);

jobCode1 = new SimpleComboBox<String>();
jobCode1.setWidth(80);
jobCode1.add("High");
jobCode1.add("Medium");
jobCode1.add("Low");
fieldSet.add(jobCode1,td);

c.add(fieldSet);
RootPanel.get().add(c);
}

private void setHeadings()
{
TableData td = new TableData();
td.setWidth("160px");
td.setHorizontalAlign(HorizontalAlignment.CENTER);

LabelField lbl0 = new LabelField("Dept");
fieldSet.add(lbl0,td);

LabelField lbl1 = new LabelField("JobCode");
fieldSet.add(lbl1,td);
}
}

kolli
30 Mar 2009, 6:22 AM
hi fother,
I am using a table to generate a list in combobox. I am using a tablelayout for the fieldset which contains a combobox, as in the example above.

kolli
1 Apr 2009, 12:39 PM
can any one help me out with this one? I need not to use a fieldset. I can use any of the layout containers..

kolli
20 Apr 2009, 6:12 AM
Can anyone help me with this one??

kolli
20 Apr 2009, 6:56 AM
Well i think i figured something out..
I removed
" td.setHorizontalAlign(HorizontalAlignment.CENTER);"
And it works perfectly now.
Now is this some kind of a bug??