Uploaded image for project: 'Spring Roo'
  1. Spring Roo
  2. ROO-3151

How to change the rows attribute in text area from default value of 3 to 10?


    • Type: Bug
    • Status: Resolved
    • Priority: Trivial
    • Resolution: Works as Designed
    • Affects Version/s: 1.2.1.RELEASE
    • Fix Version/s: None
    • Component/s: WEB MVC
    • Labels:
    • Environment:
      Windows XP, jdk1.6.0_26, spring-roo-1.2.1.RELEASE


      How to change the rows attribute in text area from default value of 3 to 10?

      I have created a string field called description with a maximum size of 5000, using Spring ROO, as shown below.

      field string --fieldName description --sizeMin 3 --sizeMax 5000 --class ~.domain.TableA

      After I compile and run the project, from the browser when I inspect the element for description field, it looks like this:

      <textarea name="description" dojoattachpoint="focusNode,containerNode,textbox" autocomplete="off" rows="3" cols="20" id="_description_id" tabindex="0" aria-disabled="false" widgetid="_description_id" value="" class="dijitTextBox dijitTextArea"></textarea>

      I want to change the rows from 3 to 10. So, I edited the file src\main\webapp\WEB-INF\tags\form\fields\textarea.tagx and changed the line from:

      <form:textarea id="_${sec_field}_id" path="${sec_field}" disabled="${disabled}" />

      <form:textarea id="_${sec_field}_id" path="${sec_field}" rows="10" disabled="${disabled}" />

      After I recompile and rerun the program, from the debugger I can verify when TextareaTag object's getRows() is called, it returns 10 due to the change made in textarea.tagx.

      However, from the browser, if I inspect the description field element, it is still 3. So, somewhere after TextareaTag object has set the attribute for the html element to 10 but before the html is actually rendered on the browser, its rows attribute value is getting changed back to 3.

      What do I need to do if I want to change the rows for textarea html element to 10?


      public class TextareaTag extends AbstractHtmlInputElementTag {

      protected int writeTagContent(TagWriter tagWriter) throws JspException

      { tagWriter.startTag("textarea"); writeDefaultAttributes(tagWriter); writeOptionalAttribute(tagWriter, ROWS_ATTRIBUTE, getRows()); writeOptionalAttribute(tagWriter, COLS_ATTRIBUTE, getCols()); writeOptionalAttribute(tagWriter, ONSELECT_ATTRIBUTE, getOnselect()); String value = getDisplayString(getBoundValue(), getPropertyEditor()); tagWriter.appendValue(processFieldValue(getName(), value, "textarea")); tagWriter.endTag(); return SKIP_BODY; }





            • Assignee:
              stewarta Alan Stewart
              vganesh Venkat Ganesh
            • Votes:
              0 Vote for this issue
              1 Start watching this issue


              • Created: