1 33 34 package com.icesoft.icefaces.samples.showcase.components.textEntry; 35 36 import javax.faces.context.FacesContext; 37 38 42 public class TextFieldsBean { 43 46 private String name; 47 private String password; 48 private String comments; 49 50 private float numberValue = 500000.0f; 51 52 57 public String getName() { 58 return name; 59 } 60 61 66 public void setName(String newValue) { 67 if (dontSet()) return; 68 69 name = newValue; 70 } 71 72 77 public String getPassword() { 78 return password; 79 } 80 81 86 public void setPassword(String newValue) { 87 if (dontSet()) return; 88 89 password = newValue; 90 } 91 92 97 public String getComments() { 98 return comments; 99 } 100 101 106 public void setComments(String newValue) { 107 if (dontSet()) return; 108 109 comments = newValue; 110 } 111 112 private boolean dontSet() { 113 return FacesContext.getCurrentInstance().getExternalContext() 114 .getRequestMap().get("RESET") != null; 115 } 116 117 122 public String reset() { 123 124 FacesContext.getCurrentInstance().getExternalContext().getRequestMap() 125 .put("RESET", Boolean.TRUE); name = ""; 127 password = ""; 128 comments = ""; 129 130 return "Done"; 131 } 132 133 134 public float getNumberValue() { 135 return numberValue; 136 } 137 138 public void setNumberValue(float numberValue) { 139 this.numberValue = numberValue; 140 } 141 } | Popular Tags |