Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    combobox and changing valueMap

    I'm using SmartGWT 2.1 and FF 3.6.3

    I want a ComboBoxItem whose valueMap changes on selection of some other combobox.
    My method of implementation is kind of working, but a lot of visual artifacts occur when the valueMap changes.
    Attachment 1.png shows the status of the changing combobox, when first clicked.
    Attachment 2.png shows the status of the changing combobox, when clicked the third (kind of working) time.

    Note: It's doing the same thing in compiled mode.

    Code:
    //		// combobox type
    		type = new ComboBoxItem("IDType", Translations.getTrans("ManageAssetWindow.AssetType.fieldLabel"));
    		type.setWidth(200);
    		type.setRequired(true);
    		final LinkedHashMap<String, String> typeMap = new LinkedHashMap<String, String>();
    		typeMap.put(vesselGuid, Translations.getTrans("ManageAssetWindow.type.Vessel"));
    		typeMap.put(vehicleGuid, Translations.getTrans("ManageAssetWindow.type.Vehicle"));
    		type.setValueMap(typeMap);
    		type.setDefaultToFirstOption(true);
    		type.addChangedHandler(new ChangedHandler() {
    			public void onChanged(ChangedEvent event) {
    				LinkedHashMap<String, String> subTypeMap = new LinkedHashMap<String, String>();
    				
    				if(event.getValue().equals((vesselGuid))){
    					subTypeMap.put(undefinedGuid,Translations.getTrans("ManageAssetWindow.subType.Undefined"));
    					subTypeMap.put(sailingBoatGuid, Translations.getTrans("ManageAssetWindow.subType.SailingBoat"));
    					subTypeMap.put(powerBoatGuid, Translations.getTrans("ManageAssetWindow.subType.PowerBoat"));
    				} else {
    					subTypeMap.put(undefinedGuid,Translations.getTrans("ManageAssetWindow.subType.Undefined"));
    				}
    				
    //				subType = new ComboBoxItem("IDSubtype", Translations.getTrans("ManageAssetWindow.AssetSubType.fieldLabel"));
    //				subType.setWidth(200);
    //				subType.setRequired(false);
    				subType.setValueMap(subTypeMap);
    //				subType.setDefaultToFirstOption(true);
    				subType.setValue(undefinedGuid);
    //				formDF.redraw();
    				formDF.markForRedraw();
    		}});
    		
    
    		// combobox subtype
    		subType = new ComboBoxItem("IDSubtype", Translations.getTrans("ManageAssetWindow.AssetSubType.fieldLabel"));
    		subType.setWidth(200);
    		subType.setRequired(false);
    		LinkedHashMap<String, String> subTypeMap = new LinkedHashMap<String, String>();
    		subTypeMap.put(undefinedGuid,Translations.getTrans("ManageAssetWindow.subType.Undefined"));
    		subTypeMap.put(sailingBoatGuid, Translations.getTrans("ManageAssetWindow.subType.SailingBoat"));
    		subTypeMap.put(powerBoatGuid, Translations.getTrans("ManageAssetWindow.subType.PowerBoat"));
    		subType.setValueMap(subTypeMap);
    		subType.setDefaultToFirstOption(true);
    Attached Files

    #2
    Looks like you have external CSS included so your getting the scrollbars inside the combobox picker.

    Comment


      #3
      You are right! If I remove the external CSS file, it works fine.
      Thanks for the nudge in the right direction.

      Comment

      Working...
      X