Announcement

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

    SelectedItem/ComboBoxItem List Error

    Hello,

    i use the 2.4 version and have a design problem. At the box i have two items but at the list i can only see a spinner and - sometimes - only a part from one element. My Code:

    Code:
    HLayout temp = new HLayout();
    		temp.setSize("100%", "40");
    
    		Label label = new Label();
    		label.setSize("50%", "35");
    		// temp.addMember(label);
    		
    		DynamicForm allgemein = new DynamicForm();
    		allgemein.setNumCols(1);
    		allgemein.setSize("100%", "40");
    		allgemein.setTitleOrientation(TitleOrientation.TOP);
    
    		raum = new ComboBoxItem("Raum");
    		//raum.setWidth(allgemein.getWidthAsString());
    		raum.setWidth(400);
    		//raum.setHeight(50);
    		raum.setAlign(Alignment.CENTER);
    		
    		raum.addChangedHandler(new ChangedHandler() {
    			
    			@Override
    			public void onChanged(ChangedEvent event) {
    				InitRaumData();
    			}
    		});
    
    		allgemein.setFields(new FormItem[] { raum });
    
    		temp.addMember(allgemein);
    		// temp.addMember(label);
    
    		HLayout temp2 = new HLayout();
    		temp2.setSize("100%", "35");
    		temp2.addMember(label);
    
    		suchen = new IButton();
    		suchen.setAutoFit(true);
    		suchen.setTitle("Suchen");
    
    		details = new IButton();
    		details.setAutoFit(true);
    		details.setTitle("Details");
    		
    		details.addClickHandler(new ClickHandler() {
    			
    			AsyncCallback<Raum> callback = new AsyncCallback<Raum>() {
    				
    				@Override
    				public void onSuccess(Raum result) {
    					if(result != null){
    						new Details(result).show();
    					}else{
    						SC.say("Raumdaten konnten nicht geladen werden");
    					}
    				}
    				
    				@Override
    				public void onFailure(Throwable caught) {
    					SC.say(caught.getLocalizedMessage());
    				}
    			};
    			
    			@Override
    			public void onClick(ClickEvent event) {
    				Attribute.async.GetRaumData(selected, "", callback);
    			}
    		});
    
    		bilder = new IButton();
    		bilder.setAutoFit(true);
    		bilder.setTitle("Bilder");
    
    		dokumente = new IButton();
    		dokumente.setAutoFit(true);
    		dokumente.setTitle("Dokumente");
    		
    		temp2.setMembersMargin(5);
    
    		temp2.addMember(suchen);
    		temp2.addMember(details);
    		temp2.addMember(bilder);
    		temp2.addMember(dokumente);
    		temp2.addMember(label);
    		
    		layout.addMember(temp);
    		layout.addMember(temp2);
    And 3 error attatchments (first for forst click, second for second click and third for third click (and so on))

    Thank you for help.
    Attached Files
    Last edited by RBS2002; 28 Jan 2011, 01:12.

    #2
    Can you put the code in the method InitRaumData?

    PS: addChangedHandler
    Called when a FormItem's value has been changed as the result of user interaction. This method fires after the newly specified value has been stored.

    Comment


      #3
      Code:
      public void InitRaumData(){
      		for(Raum tempraum: Attribute.raeume){
      			if(tempraum.getRaumname().equals(raum.getDisplayValue())){
      				selected = tempraum;
      				main.get_bemerkungen().enable();
      				main.get_benutzerdaten().enable();
      				main.get_kontaktdaten().enable();
      				main.get_raumanforderung().enable();
      				main.get_submit().enable();
      				main.get_teilnehmer().enable();
      				main.get_veranstaltungskalender().enable();
      				main.get_zeiterfassung().enable();
      				main.get_zusatzprojektion().enable();
      				main.get_raumanforderung().update(tempraum.getFlaeche(),tempraum.getStuehle(),tempraum.getStuehle(),tempraum.getBeschallung());
      				main.get_kontaktdaten().SetData(Attribute.benutzer.getEmail(), Attribute.benutzer.getTelefon(), Attribute.benutzer.getMobil(), Attribute.benutzer.getFax());
      				main.get_benutzerdaten().update(Attribute.benutzer.getAbteilung(), Attribute.benutzer.getName(), Attribute.benutzer.getGeschlecht());
      				return;
      			}
      		}
      		selected = null;
      		SC.warn("Es konnten keine Raumdaten gefunden werden");
      		main.get_bemerkungen().disable();
      		main.get_benutzerdaten().disable();
      		main.get_kontaktdaten().disable();
      		main.get_raumanforderung().disable();
      		main.get_submit().disable();
      		main.get_teilnehmer().disable();
      		main.get_veranstaltungskalender().disable();
      		main.get_zeiterfassung().disable();
      		main.get_zusatzprojektion().disable();
      	}
      I set the display value with the "setValue()" Option if at least one item is at the list (every time) and Initialize the first time without event. Until this everything works fine and the value is displayed, but after that i get this error. Redraw and everything did not work - at a second box i initialize the value map with a static code (at initialisation) and everything works fine

      Comment


        #4
        The visual glitches here can be caused by having external CSS - see the FAQ.

        Comment


          #5
          maybe - but the only css file i use is the css file from the created gwt project and the css file from smartgwt

          Comment


            #6
            Yup. Now if you actually read the FAQ, you'll be all set.

            Comment

            Working...
            X