Announcement Announcement Module
Collapse
No announcement yet.
Issues with "fields" tag library generated by Roo - how to fix? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Issues with "fields" tag library generated by Roo - how to fix?

    This question is in reference to the .tagx files generated by Roo as part of the web scaffolding, under the directory "WEB-INF/tags/form/fields".

    The <field:textarea/> tag defined in WEB-INF/tags/form/fields/textarea.tagx has a "rows" attribute. Setting it to a value has no visible effect. Has anyone been able to fix this in his/her local copy of textarea.tagx?

    Also, the <field:input/> tag defined in WEB-INF/tags/form/fields/input.tagx does not have a "size" attribute. Has anyone been able to add one successfully?

    I guess one obvious solution would be to ditch the tag library entirely but I don't want to unnecessarily redo any work that has already been done to bind fields to Java domain classes.

  • #2
    Another issue is that I need a radiobutton. Which approach has been taken by others here?

    A. Add a radiobutton.tagx file

    B. Delete the xmlns:field="urn:jsptagdir:/WEB-INF/tags/form/fields" and xmlns:form="urn:jsptagdir:/WEB-INF/tags/form" from the generated .jspx file and replace with xmlns:form="http://www.springframework.org/tags/form"

    Comment


    • #3
      a <input type="radio" id="myid"> in your .jspx file.

      add size to <field:input> ? why you control by css file?

      Comment


      • #4
        Originally posted by sjbwylbs View Post
        a <input type="radio" id="myid"> in your .jspx file.

        add size to <field:input> ? why you control by css file?
        The customer wants a particular text field to be wider than the other text fields in this particular form.

        So far I have had an easier time using the Spring tag library instead of the one created by Roo.

        Comment


        • #5
          Modifying input.tagx

          I was able to add the cssStyle tag to the input.tagx and this allowed me to specify the width of each input "text"

          Roo generated jspx: <field:input cssStyle="width:10px" ... >

          Modification to input.tagx:
          added : <jsp:directive.attribute name="cssStyle" type="java.lang.String" required="false" description="Add style attribute to element" />

          Then added style="${cssStyle}" to the <input>
          and cssStyle="${cssStyle} to the <form:input>


          Not sure if this is the correct way to do it, but it worked.
          I wonder why they didn't have the input.tagx (and the other field tagx) handle all the attributes in defined in spring-form.tld
          Or is the idea, that Spring Roo generates the basic jspx using Spring Roo Form tags, and your supposed to remove the Spring Roo tags and replace with Spring Form tags?
          Last edited by btlife; Sep 11th, 2010, 01:32 PM.

          Comment


          • #6
            Just found a couple of CSS change in the standard.css you can add to format the input and text area


            TextArea: Modify .dijitTextArea

            Code:
            .dijitTextArea  {
               min-height:22em !important;
            }
            Input: Add specific style

            Code:
            div#widget__<fieldname>_id {
                width: 75%;
            }

            Comment

            Working...
            X