Uploaded image for project: 'Kuali Rice Development'
  1. Kuali Rice Development
  2. KULRICE-8711

Default value property of DataField should have type of Object

    Details

    • Type: Bug Fix
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.4
    • Component/s: Development
    • Security Level: Public (Public: Anyone can view)
    • Labels:
      None
    • Rice Module:
      KRAD
    • KAI Review Status:
      Not Required
    • KTI Review Status:
      Not Required
    • Include in Release Notes?:
      Yes

      Description

      Currently the defaultValue property of DataField is type String. This prevents setting default values for properties other than string (like Date) through expressions. The type should be changed to Object

        Attachments

          Issue Links

            Activity

            jkneal Jerry Neal (Inactive) created issue -
            jkneal Jerry Neal (Inactive) made changes -
            Field Original Value New Value
            Link This issue cloned from KULRICE-7208 [ KULRICE-7208 ]
            jkneal Jerry Neal (Inactive) made changes -
            Issue Type Task [ 3 ] Bug Fix [ 1 ]
            Fix Version/s 2.3 [ 16595 ]
            Fix Version/s 2.2.1 [ 16733 ]
            Description Currently the defaultValue property of DataField is type String. This prevents setting default values for properties other than string (like Date) through expressions. The type should be changed to Object
            Priority Major [ 3 ] Critical [ 2 ]
            Assignee Jerry Neal [ jkneal ]
            jkneal Jerry Neal (Inactive) made changes -
            Link This issue cloned to KULRICE-8713 [ KULRICE-8713 ]
            gilesp Peter Giles (Inactive) made changes -
            Rank Ranked higher
            jcoltrin Jessica Coltrin (Inactive) made changes -
            Fix Version/s 2.4 [ 16913 ]
            Fix Version/s 2.3 [ 16595 ]
            jcoltrin Jessica Coltrin (Inactive) made changes -
            Fix Version/s 2.4-backlog [ 16596 ]
            Fix Version/s 2.4 [ 16913 ]
            jcoltrin Jessica Coltrin (Inactive) made changes -
            Priority Critical [ 2 ] Major [ 3 ]
            spatterson Shem Patterson (Inactive) made changes -
            Workflow custom [ 161576 ] Copy of custom for rice [ 207710 ]
            spatterson Shem Patterson (Inactive) made changes -
            Workflow Copy of custom for rice [ 207710 ] custom [ 217458 ]
            spatterson Shem Patterson (Inactive) made changes -
            Workflow custom [ 217458 ] Rice Workflow [ 227206 ]
            jcoltrin Jessica Coltrin (Inactive) made changes -
            Fix Version/s 2.4 [ 16913 ]
            Fix Version/s 2.4-backlog [ 16596 ]
            Hide
            dsiebert Daniel Seibert (Inactive) added a comment -

            My 2 cents after looking attempting to set a defaultValue for a date:

            I see two quick, easy solutions:
            1. In ViewHelperServiceImpl.populateDefaultValueForField(). Check the dataField for a propertyEditor assigned. If so, use it. If not, use ObjectPropertReference.setPropertyValue() to handle the primitive type cases. (In this case, in the maintenance view definition, assigned p:propertyEditorClass="org.kuali.rice.krad.web.bind.UifDateEditor" )

            2. In ObjectPropertyReference.setPropertyValue(), add logic to handle dates with UifDateEditor in addition to the primitive types.

            Show
            dsiebert Daniel Seibert (Inactive) added a comment - My 2 cents after looking attempting to set a defaultValue for a date: I see two quick, easy solutions: 1. In ViewHelperServiceImpl.populateDefaultValueForField(). Check the dataField for a propertyEditor assigned. If so, use it. If not, use ObjectPropertReference.setPropertyValue() to handle the primitive type cases. (In this case, in the maintenance view definition, assigned p:propertyEditorClass="org.kuali.rice.krad.web.bind.UifDateEditor" ) 2. In ObjectPropertyReference.setPropertyValue(), add logic to handle dates with UifDateEditor in addition to the primitive types.
            Hide
            dsiebert Daniel Seibert (Inactive) added a comment -

            On changing type of defaultValue property from String to Object:
            1. some existing code is expecting a String using StringUtils to check for empty and notEmpty
            2. If using Spring EL to specify a date, you still need a String to Date conversion.

            Show
            dsiebert Daniel Seibert (Inactive) added a comment - On changing type of defaultValue property from String to Object: 1. some existing code is expecting a String using StringUtils to check for empty and notEmpty 2. If using Spring EL to specify a date, you still need a String to Date conversion.
            dsiebert Daniel Seibert (Inactive) made changes -
            Assignee Jerry Neal [ jkneal ] Daniel Seibert [ dsiebert ]
            dsiebert Daniel Seibert (Inactive) logged work - 06/Jan/14 6:37 PM
            • Time Spent:
              1 day
               
              Changed defaultValue to Object.
              Updated code using it where necessary.

              Also investigated using PropertyEditors with defaultValues.
            dsiebert Daniel Seibert (Inactive) made changes -
            Remaining Estimate 0 minutes [ 0 ]
            Time Spent 1 day [ 28800 ]
            Worklog Id 91742 [ 91742 ]
            dsiebert Daniel Seibert (Inactive) made changes -
            Status Open [ 1 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]
            jcoltrin Jessica Coltrin (Inactive) made changes -
            Include in Release Notes? Yes [ 14658 ]
            jcoltrin Jessica Coltrin (Inactive) made changes -
            Status Resolved [ 5 ] Closed [ 6 ]

              People

              • Assignee:
                dsiebert Daniel Seibert (Inactive)
                Reporter:
                jkneal Jerry Neal (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 day
                  1d