Description
Provides a HTML <textarea> form element.
This component must be wrapped by a Form component.
Use the HTML "wrap" attribute as an informal
parameter to control word wrapping. Wrap attribute values include:
"off", "vitual", "physical", "soft" and "hard".
Prior to release 2.2, this component was named
Text.
|
Examples
The Text component is used in this example eto provide a customer comments
feedback <textarea>.
<table valign="middle">
<form jwcid="@Form" listener="ognl:listeners.formSubmit">
<tr>
<td>Your Comments</td>
<td><textarea jwcid="commentsText" rows="5" cols="20"/></td>
</tr>
<tr align="right">
<td colspan="2"><input type="submit" value="Submit"/></td>
</tr>
</form>
</table>
public class CustomerCommentsPage extends BasePage {
private final static String COMMENTS = "Please enter your comments here";
private String comments = COMMENTS;
public void formSubmit(IRequestCycle requestCycle) {
// Proccess customer comments
}
public String getComments() { return comments; }
public void setComments(String value) {
comments = value;
fireObservedChange("comments", value);
}
public void detach() {
comments = COMMENTS;
super.detach();
}
}
|