Results 1 to 8 of 8

Thread: TextArea cols?

  1. #1
    Join Date
    Apr 2008
    Posts
    20

    Default TextArea cols?

    Using 1.1.0.RELEASE a text area generated by scaffolding seems to default to cols="20". If I change textarea.tagx to include a "cols" property, it doesn't have any affect:

    Code:
    <form:textarea id="_${sec_field}_id" path="${sec_field}" disabled="${disabled}" cols="40" />
    It still renders with cols="20".

    I also changed the width in css since it appears both the css and cols constrains the width:

    Code:
    .dijitTextArea{
            min-height:5.5em !important;
            max-height:22em !important;
            overflow-y: auto !important;
            max-width: 400px;
    }

  2. #2
    Join Date
    Sep 2009
    Posts
    101

    Default

    You can also try using the cssStyle attribute in the form:textarea tag.

    <form:textarea id="_${sec_field}_id" ... cssStyle="width:400px;height:100px;"/>

  3. #3
    Join Date
    Apr 2008
    Posts
    20

    Default

    the problem is, to fix it, you need to fix both css "width" and "cols"

  4. #4
    Join Date
    Apr 2008
    Posts
    20

    Default

    so I found that if I remove the following from the dijit.css

    Code:
    .dijitTextArea[cols] {width: auto;}
    it works correctly. However I can't seem to override this css. Not sure how to do that but this doesn't work:

    Code:
    .dijitTextArea[cols] {width: none;}

  5. #5
    Join Date
    Mar 2008
    Location
    Sydney, AU
    Posts
    974

    Default

    You should be able to override CSS definitions in dijit.css in your own application CSS definitions. Take a look at standard.css and alt.css and scroll all the way down to see that we are doing this already.
    Stefan Schmidt
    Software Engineer, Spring Roo
    SpringSource - a division of VMware
    twitter @schmidtstefan

  6. #6
    Join Date
    Apr 2008
    Posts
    20

    Default

    hmm. The css links in load-scripts.tagx is:

    Code:
      <link rel="stylesheet" type="text/css" media="screen" href="${roo_css_url}"><!-- required for FF3 and Opera --></link>
      <link rel="stylesheet" type="text/css" href="${tundra_url}"><!-- required for FF3 and Opera --></link>

    shouldn't the order by switched so changes to the apps css override digit/tundra?

  7. #7
    Join Date
    Mar 2008
    Location
    Sydney, AU
    Posts
    974

    Default

    @dailer,

    I have not seen any issues regarding the sequence of loading the style sheets when customizing Dojo styles. However, I swapped the declarations around as you suggested: https://jira.springsource.org/browse/ROO-2136

    HTH,
    Stefan
    Stefan Schmidt
    Software Engineer, Spring Roo
    SpringSource - a division of VMware
    twitter @schmidtstefan

  8. #8

    Default

    You could try setting the dijit.form.SimpleTextarea attributes, if you wish to set rows and cols of textarea

    Spring.addDecoration(new Spring.ElementDecoration({
    elementId : '_${sec_field}_id',
    widgetType : 'dijit.form.SimpleTextarea',
    widgetAttrs : {
    cols: ${cols},
    disabled : ${disabled},
    rows: ${rows}
    }
    }));
    Read more on this blog
    Spring Roo:: Adjusting Textarea rows and cols (width and height)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •