Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You were on the right track. Use a text area element instead of input type="text". I started with the source of EditTextCell and inserted textarea elements instead of input at the appropriate places. See below for code</p> <pre><code>public class TextAreaEditCell extends AbstractEditableCell&lt;String, TextAreaEditCell.ViewData&gt; { interface Template extends SafeHtmlTemplates { @Template("&lt;textarea tabindex=\"-1\" rows=\"{1}\" cols=\"{2}\" &gt;{0}&lt;/textarea&gt;") SafeHtml input(String value, Integer rows, Integer cols); } ... private int rows, cols; /** * Construct a new EditTextCell that will use a * {@link SimpleSafeHtmlRenderer}. */ public TextAreaEditCell() { this(SimpleSafeHtmlRenderer.getInstance(), 1, 20); } /** * Construct a new EditTextCell that will use a given * {@link SafeHtmlRenderer} to render the value when not in edit mode. * * @param renderer * a {@link SafeHtmlRenderer SafeHtmlRenderer&lt;String&gt;} instance */ public TextAreaEditCell(SafeHtmlRenderer&lt;String&gt; renderer, int r, int c) { super("click", "keyup", "keydown", "blur"); rows = r; cols = c; ... } else if ("blur".equals(type)) { // Commit the change. Ensure that we are blurring the input element // and // not the parent element itself. EventTarget eventTarget = event.getEventTarget(); if (Element.is(eventTarget)) { Element target = Element.as(eventTarget); if ("textarea".equals(target.getTagName().toLowerCase())) { ... /** * Get the input element in edit mode. */ private TextAreaElement getInputElement(Element parent) { return parent.getFirstChild().&lt;TextAreaElement&gt; cast(); } ... private String updateViewData(Element parent, ViewData viewData, boolean isEditing) { TextAreaElement input = (TextAreaElement) parent.getFirstChild(); // InputElement input = (InputElement) parent.getFirstChild(); ... </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload