View Full Version : SimpleCombobox FieldLabel not showing
bee7er
11 Jun 2009, 3:37 AM
Hi,
Using ExtJS 2.2, running in IE 6.
I am placing a SimpleComboBox into a FieldSet which goes into a FormPanel. The FormPanel is placed in a Window. The problem I am having is that the FieldLabel (setFieldLabel("label text") ) for the SimpleComboBox is not showing in the panel. The listbox is left aligned and there is simply no label text at all.
Debugging in hosted mode I can see that the object is being set correctly.
Attribute 'hideLabel' is set to false.
I have varied the width of the FieldSet and FormPanel and those changes make no difference.
Any advice gratefully received.
Animal
11 Jun 2009, 4:04 AM
What is setFieldLabel?
http://extjs.com/deploy/ext-3.0-rc2/docs/?class=Ext.form.Field&member=fieldLabel
bee7er
11 Jun 2009, 4:19 AM
I am using GWT with this class com.extjs.gxt.ui.client.widget.form.SimpleComboBox. I am rather new to these technologies. I guess this could be a GWT issue.
Animal
11 Jun 2009, 4:25 AM
Why post in this folder then?
bee7er
11 Jun 2009, 4:41 AM
Because I have to start somewhere. I can imagine finding a GWT forum and being pointed over here from there. If Ihad a clear idea how these technologies related to each other I would have a better chance of solving the issue. Thanks for the quick response. I'll find a GWT forum.
fspab
15 Jun 2009, 4:29 AM
Even if the FieldSet is in a FormPanel you have to set the Layout the see the Label.
You should have something like:
FormPanel panel = new FormPanel();
FieldSet fieldSet = new FieldSet();
FormLayout layout = new FormLayout();
ComboBox combo = new ComboBox();
fieldSet.setLayout(layout);
combo.setFieldLabel("Combo label");
fieldSet.add(combo);
panel.add(fieldSet);
I had this problem last week ;)
bee7er
15 Jun 2009, 6:59 AM
Thanks fspab. Still not working but that helps. It drew my attention to the fact that one can specify layouts for the FieldSet aswell as the FormPanel. I am trying various combinations to see if I can get the labels to appear. Did you change anything else that might have had an effect?
Cheers
fspab
15 Jun 2009, 7:10 AM
no, I only had to set the FieldSet's layout to FormLayout to have the label shown.
I think that FormLayout is mandatory if you want to use setFieldLabel()
Be aware that FormLayout only works with widget's that are instances of Field
bee7er
16 Jun 2009, 4:42 AM
Thanks (again) fspab. This is now working. Full solution was to specify FormLayout for my FormPanel and a different FormLayout for each FieldSet. Originally I had no form layouts specified, then one for the FormPanel but none fo the FieldSets, then I reused the same FormLayout, etc. None of which worked.
Cheers.
Powered by vBulletin® Version 4.1.5 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.