We are on a nightly build dated 12-7-2010 and we're seeing some strange behavior with SelectItem:
Almost every other time we create this instance only the first (out of 4 options) are displayed in the pick list. In other words, every other instance that is created will display the 4 intended available options. Some do, and some don't (only displaying the first out of four options).
Is this a defect related to a nightly build? Has anyone seen this behavior before? This code was working consistently before we upgraded SmartGWT versions.
Code:
Criteria c = new Criteria(); c.setAttribute("ClientId", Long.toString(getUser().getId())); timeFrameSelectItem = new SelectItem("postTradeTimeFrame", "Time Frame"); timeFrameSelectItem.setOptionDataSource(DataSource.get("post-trade-time-frame")); timeFrameSelectItem.setValueField("id"); timeFrameSelectItem.setOptionCriteria(c); timeFrameSelectItem.setAutoFetchData(Boolean.TRUE); timeFrameSelectItem.setDefaultToFirstOption(true); timeFrameSelectItem.setWidth(200); timeFrameSelectItem.addFocusHandler(new FocusHandler(){ public void onFocus(FocusEvent event) { ListGridRecord record = timeFrameSelectItem.getSelectedRecord(); if(record != null && !record.getAttribute("name").startsWith("Custom")) { timeFrameStartDate = record.getAttributeAsDate("startPoint"); timeFrameEndDate = record.getAttributeAsDate("endPoint"); } } }); timeFrameSelectItem.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event){ logAtClient("onClicked timeFrameSelect"); ListGridRecord record = timeFrameSelectItem.getSelectedRecord(); if(record != null) { String name = record.getAttributeAsString("name"); if(name.startsWith("Custom Dates")){ timeFrameSelectItem.clearValue(); } } } }); timeFrameSelectItem.addChangedHandler(new ChangedHandler() { public void onChanged(ChangedEvent event) { if(benchmarksWindow != null) benchmarksWindow.close(); ListGridRecord record = timeFrameSelectItem.getSelectedRecord(); if(record != null) { String name = record.getAttributeAsString("name"); if(name.startsWith("Custom Dates")){ //parse the custom dates and prime the popup dates if(name.contains("(")) { int first = name.lastIndexOf("("); int last = name.lastIndexOf(")"); String dateString = name.substring(first + 1, last); String[] dates = dateString.split(" - "); DateTimeFormat sdf = DateTimeFormat.getFormat("MM/dd/yy"); timeFrameStartDate = sdf.parse(dates[0]); timeFrameEndDate = sdf.parse(dates[1]); } createCustomTimeFrameWindow(); } else { PostTradeCubeDimensionView postTradeCubeDimensionView = (PostTradeCubeDimensionView)baseCubeDimensionView; postTradeCubeDimensionView.setStartDate(record.getAttributeAsDate("startPoint")); postTradeCubeDimensionView.setEndDate(record.getAttributeAsDate("endPoint")); postTradeCubeDimensionView.refreshAllDimensions(); } } } });
Is this a defect related to a nightly build? Has anyone seen this behavior before? This code was working consistently before we upgraded SmartGWT versions.
Comment