CssLayout getCss() does not set a variable?

Hi All,

Here is my peace of code, why does the name never get set?


            private String name;
            CssLayout cssLayoutLife = new CssLayout() {
	    private static final long serialVersionUID = 1L;

           @Override
            protected String getCss(Component c) {
                if (c instanceof Label) {
                	if(life > 50) {                	
	                        name = "abc";
                		return "background: lightgreen"; 
                	}
                        else if(life < 50 && life > 20){   
                                 name = "def";                 	
                		return "background: #FFCC00";       								
        	        }
        	        else if(life < 20 && life > 10){        
                                  name = "ghi";				
        	        	return "background: #FFFF33";        				        				
        	         }
                }                                  
                return null;
            }
        };      

Debug to see what happens in your code, the problem is there. The getCss() method is called by the framework on the paint phase.