| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
|
| 14 |
|
|
| 15 |
|
|
| 16 |
|
|
| 17 |
|
|
| 18 |
|
|
| 19 |
|
package net.wotonomy.web; |
| 20 |
|
|
| 21 |
|
import net.wotonomy.foundation.NSArray; |
| 22 |
|
import net.wotonomy.foundation.NSDictionary; |
| 23 |
|
|
| 24 |
|
|
| 25 |
|
|
| 26 |
|
|
| 27 |
|
|
| 28 |
|
|
| 29 |
|
|
| 30 |
|
public class WOText extends WOInput { |
| 31 |
|
|
| 32 |
|
public WOText() { |
| 33 |
0 |
super(); |
| 34 |
0 |
} |
| 35 |
|
|
| 36 |
|
public WOText(String n, NSDictionary m, WOElement t) { |
| 37 |
0 |
super(n, m, t); |
| 38 |
0 |
} |
| 39 |
|
|
| 40 |
|
protected String inputType() { |
| 41 |
0 |
return "TEXTAREA"; |
| 42 |
|
} |
| 43 |
|
|
| 44 |
|
protected Object value(WOContext c) { |
| 45 |
0 |
Object fieldValue = valueForProperty("value", c.component()); |
| 46 |
0 |
if (fieldValue == null) { |
| 47 |
0 |
fieldValue = ""; |
| 48 |
|
} |
| 49 |
0 |
return formattedValue(fieldValue, c.component()); |
| 50 |
|
} |
| 51 |
|
|
| 52 |
|
public void takeValuesFromRequest(WORequest r, WOContext c) { |
| 53 |
0 |
Object val = r.formValueForKey(inputName(c)); |
| 54 |
0 |
if ( val != null ) |
| 55 |
0 |
setValueForProperty("value", formattedValue(val, c.component()), c.component()); |
| 56 |
0 |
} |
| 57 |
|
|
| 58 |
|
public void appendToResponse(WOResponse r, WOContext c) { |
| 59 |
0 |
r.appendContentString("<TEXTAREA NAME=\""); |
| 60 |
0 |
r.appendContentString(inputName(c)); |
| 61 |
0 |
r.appendContentString("\""); |
| 62 |
0 |
String moreFields = additionalHTMLProperties(c.component(), new NSArray(new Object[]{ |
| 63 |
0 |
"name", "value" })); |
| 64 |
0 |
if (moreFields != null && moreFields.length() > 0) |
| 65 |
0 |
r.appendContentString(moreFields); |
| 66 |
0 |
r.appendContentString(">"); |
| 67 |
0 |
moreFields = value(c).toString(); |
| 68 |
0 |
if (moreFields != null && moreFields.length() > 0) |
| 69 |
0 |
r.appendContentString(moreFields); |
| 70 |
0 |
r.appendContentString("</TEXTAREA>"); |
| 71 |
0 |
} |
| 72 |
|
} |