Announcement Announcement Module
Collapse
No announcement yet.
TextArea cols? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    You can also try using the cssStyle attribute in the form:textarea tag.

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

    Comment


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

      Comment


      • #4
        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;}

        Comment


        • #5
          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.

          Comment


          • #6
            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?

            Comment


            • #7
              @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

              Comment


              • #8
                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)

                Comment

                Working...
                X