Hi all,
I'm starting to use SmartGWT 2.2, and I have some serious troubles with the css-layout of a DynamicForm objects. The problems I have are:
css code:
.regular {font-size:16px;white-space:nowrap;vertical-align:top;}
GWT-code is included below.
1. TextItem's do not react on .setTitleStyle("regular"), only the RadioGroup does. The white-space:nowrap is taken into account, but the font-size is ignored, and the vertical-align is only listened to when the focus is gained (which makes titles go up and down on a focus).
Adding .regular:focus does not help for the focus vertical-alignment problem.
2. I don't know how to set the default fontsize to 16 (instead of 15) for smartgwt in general, without having to override all styles manually for each item. I do have a *{font-size: 16px;} in the .css, but the TextItem input-fields are still in 15.
3. The DynamicForm also includes a SelectItem. This SelectItem listens to .setTitleStyle("regular") but not when it has the focus. Furthermore, although there are no items added to it yet, it has a width which is bigger then the complete DynamicForm is added to, which creates a horizontal scrollbar in this tab for no reason.
Thanks for any hints!!
GWT-code:
tabLayoutPanel = new TabSet();
tabLayoutPanel.setWidth(400);
tabLayoutPanel.setHeight(500);
DynamicForm formGeneral = new DynamicForm();
formGeneral.setCellPadding(5);
tab1 = new Tab(i18nContacts.general());
tab1.setPane(formGeneral);
ge0 = new RadioGroupItem();
ge0.setTitle("Type");
ge0.setTitleStyle("regular");
ge0.setTitleAlign(Alignment.LEFT);
ge0.setTitleVAlign(VerticalAlignment.TOP);
ge0.setValueMap(i18nContacts.person(), i18nContacts.company());
ge0.addChangeHandler(new ChangeHandler() {
@Override
public void onChange(ChangeEvent event) {
// ....
}
});
TextItem ge1 = new TextItem("1", i18nContacts.firstName());
ge1.setTitleStyle("regular");
ge1.setTitleAlign(Alignment.LEFT);
ge1.setTitleVAlign(VerticalAlignment.TOP);
ge6 = new SelectItem("6", i18nContacts.connectedToCompany());
ge6.setTitleStyle("regular");
ge6.setTitleAlign(Alignment.LEFT);
ge6.setTitleVAlign(VerticalAlignment.TOP);
formGeneral.setFields(ge0, ge1, ge2, ge3, ge4, ge5, ge6);
tabLayoutPanel.setTabs(tab1, tab2);
Niels
I'm starting to use SmartGWT 2.2, and I have some serious troubles with the css-layout of a DynamicForm objects. The problems I have are:
css code:
.regular {font-size:16px;white-space:nowrap;vertical-align:top;}
GWT-code is included below.
1. TextItem's do not react on .setTitleStyle("regular"), only the RadioGroup does. The white-space:nowrap is taken into account, but the font-size is ignored, and the vertical-align is only listened to when the focus is gained (which makes titles go up and down on a focus).
Adding .regular:focus does not help for the focus vertical-alignment problem.
2. I don't know how to set the default fontsize to 16 (instead of 15) for smartgwt in general, without having to override all styles manually for each item. I do have a *{font-size: 16px;} in the .css, but the TextItem input-fields are still in 15.
3. The DynamicForm also includes a SelectItem. This SelectItem listens to .setTitleStyle("regular") but not when it has the focus. Furthermore, although there are no items added to it yet, it has a width which is bigger then the complete DynamicForm is added to, which creates a horizontal scrollbar in this tab for no reason.
Thanks for any hints!!
GWT-code:
tabLayoutPanel = new TabSet();
tabLayoutPanel.setWidth(400);
tabLayoutPanel.setHeight(500);
DynamicForm formGeneral = new DynamicForm();
formGeneral.setCellPadding(5);
tab1 = new Tab(i18nContacts.general());
tab1.setPane(formGeneral);
ge0 = new RadioGroupItem();
ge0.setTitle("Type");
ge0.setTitleStyle("regular");
ge0.setTitleAlign(Alignment.LEFT);
ge0.setTitleVAlign(VerticalAlignment.TOP);
ge0.setValueMap(i18nContacts.person(), i18nContacts.company());
ge0.addChangeHandler(new ChangeHandler() {
@Override
public void onChange(ChangeEvent event) {
// ....
}
});
TextItem ge1 = new TextItem("1", i18nContacts.firstName());
ge1.setTitleStyle("regular");
ge1.setTitleAlign(Alignment.LEFT);
ge1.setTitleVAlign(VerticalAlignment.TOP);
ge6 = new SelectItem("6", i18nContacts.connectedToCompany());
ge6.setTitleStyle("regular");
ge6.setTitleAlign(Alignment.LEFT);
ge6.setTitleVAlign(VerticalAlignment.TOP);
formGeneral.setFields(ge0, ge1, ge2, ge3, ge4, ge5, ge6);
tabLayoutPanel.setTabs(tab1, tab2);
Niels
Comment