1 18 package org.alfresco.web.ui.common.component; 19 20 import javax.faces.context.FacesContext; 21 import javax.faces.el.ValueBinding; 22 23 28 public class UIListItems extends SelfRenderingComponent 29 { 30 private Object value; 31 32 35 public String getFamily() 36 { 37 return "org.alfresco.faces.ListItems"; 38 } 39 40 43 public Object getValue() 44 { 45 if (this.value == null) 46 { 47 ValueBinding vb = getValueBinding("value"); 48 if (vb != null) 49 { 50 this.value = vb.getValue(getFacesContext()); 51 } 52 } 53 54 return this.value; 55 } 56 57 60 public void setValue(Object value) 61 { 62 this.value = value; 63 } 64 65 68 public void restoreState(FacesContext context, Object state) 69 { 70 Object values[] = (Object [])state; 71 super.restoreState(context, values[0]); 73 this.value = values[1]; 74 } 75 76 79 public Object saveState(FacesContext context) 80 { 81 Object values[] = new Object [2]; 82 values[0] = super.saveState(context); 84 values[1] = this.value; 85 return (values); 86 } 87 } 88 89 | Popular Tags |