v9.0p_2014-02-28/EVAL Deployment 2014-02-28
Firefox/26.0
code example:
Problem:
companytypeidField.setDisplayField("companytypedescription")
Do not give me the expected results (outputs "companytypeid" instead of "companytypedescription"). What am I doing wrong?
Firefox/26.0
Code:
import com.smartgwt.client.data.Criteria; import com.smartgwt.client.types.GroupStartOpen; import com.smartgwt.client.types.SortDirection; import com.smartgwt.client.widgets.form.fields.SelectItem; import com.smartgwt.client.widgets.grid.ListGrid; import com.smartgwt.client.widgets.grid.ListGridField; public class CompanySelectItem extends SelectItem { public CompanySelectItem() { super(); } public void setStatustypeID(Integer StatustypeID) { Criteria myCriteria = new Criteria(); myCriteria.addCriteria("statustypeid", StatustypeID); setOptionCriteria(myCriteria); } public void setCompanytypeID(Integer CompanytypeID) { Criteria myCriteria = new Criteria(); myCriteria.addCriteria("companytypeid", CompanytypeID); setOptionCriteria(myCriteria); } public void showCompanySelectItem() { setOptionDataSource(CompanyModule.companyDS); setValueField("companyid"); setDisplayField("companyname"); setPickListWidth(300); ListGridField companynameField = new ListGridField("companyname", "Название"); ListGridField companytypeidField = new ListGridField("companytypeid", "Тип компании"); companytypeidField.setOptionDataSource(CompanytypeModule.companytypeDS); companytypeidField.setDisplayField("companytypedescription"); companytypeidField.setAutoFetchDisplayMap(true); // companytypeidField.setHidden(true); ListGrid pickListProperties = new ListGrid(); // pickListProperties.setGroupStartOpen(GroupStartOpen.ALL); // pickListProperties.setGroupByField("companytypeid"); pickListProperties.setSortDirection(SortDirection.DESCENDING); pickListProperties.setSortField("companyname"); pickListProperties.setAutoFetchData(true); setPickListProperties(pickListProperties); setPickListFields(companynameField, companytypeidField); setAutoFetchData(true); } }
Code:
CompanySelectItem сompanyItem = new CompanySelectItem(); сompanyItem.setStatustypeID(STATUSTYPE_ACTIVE); сompanyItem.showCompanySelectItem();
companytypeidField.setDisplayField("companytypedescription")
Do not give me the expected results (outputs "companytypeid" instead of "companytypedescription"). What am I doing wrong?
Comment