OFBiz
  1. OFBiz
  2. OFBIZ-2021

ModelFormField.java does not use the type size to define the textField.setMaxlength

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: framework
    • Labels:
      None

      Description

      uses
      textField.setMaxlength(Integer.valueOf(60));
      instead of setting it to the size defined by the type.

        Activity

        Hide
        vu hong thuan added a comment -

        I think we would specify length of field type in ModelField.java
        So we can get the specified length of field type to put into ModelFormField.java.
        Then we can use
        textField.setMaxlength(modelField.getLength())
        instead of
        textField.setMaxlength(Integer.valueOf(60));

        Show
        vu hong thuan added a comment - I think we would specify length of field type in ModelField.java So we can get the specified length of field type to put into ModelFormField.java. Then we can use textField.setMaxlength(modelField.getLength()) instead of textField.setMaxlength(Integer.valueOf(60));
        Hide
        BJ Freeman added a comment -

        Modelfield.java deals with
        ccInfo.columnSize
        but does not make it public value.
        so
        textField.setMaxlength(modelField.getcolumnSize())

        any input from anyone else
        do you want to make a patch?

        http://docs.ofbiz.org/display/OFBADMIN/OFBiz+Contributors+Best+Practices

        Show
        BJ Freeman added a comment - Modelfield.java deals with ccInfo.columnSize but does not make it public value. so textField.setMaxlength(modelField.getcolumnSize()) any input from anyone else do you want to make a patch? http://docs.ofbiz.org/display/OFBADMIN/OFBiz+Contributors+Best+Practices
        Hide
        BJ Freeman added a comment -

        also not that ModelFormField.java
        will have to be re-factored to use this new information.
        the if else will have to be redone, since some fields types are not the same.
        then can be done by
        1) removing the textField.setMaxlength(Integer.valueOf(60)); from all the if and make a new structure for max length.
        this allows the display length to be grouped but the max length to be independent.
        2) redo the complete if structure so that each type is handled indepedently.

        any input as to what would be best.

        Show
        BJ Freeman added a comment - also not that ModelFormField.java will have to be re-factored to use this new information. the if else will have to be redone, since some fields types are not the same. then can be done by 1) removing the textField.setMaxlength(Integer.valueOf(60)); from all the if and make a new structure for max length. this allows the display length to be grouped but the max length to be independent. 2) redo the complete if structure so that each type is handled indepedently. any input as to what would be best.
        Hide
        BJ Freeman added a comment -

        any reason we can not make the widths for types configurable?

        Show
        BJ Freeman added a comment - any reason we can not make the widths for types configurable?

          People

          • Assignee:
            Scott Gray
            Reporter:
            BJ Freeman
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:

              Development