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

Configuring separate add line fields for a collection causes and exception when attempting to add a line

    Details

    • Type: Bug Fix
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0.0-rc4, 2.0
    • 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

      Description

      This is the description from Venkat:

      <property name="addLineFields">
      <list>
      <bean parent="Uif-InputField" p:propertyName="startDate" p:label="Start Date" p:required="true">
      <property name="control">
      <bean parent="Uif-DateControl" p:size="10" p:watermarkText="mm/dd/yyyy"/>
      </property>
      </bean>
      </list>
      </property>

      Error

      java.lang.ClassCastException: org.kuali.rice.krad.uif.widget.LightBox cannot be cast to org.kuali.rice.krad.uif.field.Field
      at org.kuali.rice.krad.uif.service.impl.ViewHelperServiceImpl.performComponentLifecycle(ViewHelperServiceImpl.java:256)
      at org.kuali.rice.krad.web.controller.UifControllerBase.updateComponent(UifControllerBase.java:414)
      at org.kuali.rice.krad.web.controller.UifControllerBase.addLine(UifControllerBase.java:183)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176)
      at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:436)
      at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:424)
      at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:900)

      We don't currently have a test case for this. In the kitchen sink we have collection6 which uses the 'separateAddLine', however it uses the same fields as existing. We should modify that to also specify 'addLineFields' (making it a slightly different set) so we can test this.

      Looks like it is getting mixed up in the updateComponent where it tries to get all the children to update the refresh component state. Likely an ID problem.

        Attachments

          Activity

          Hide
          jkneal Jerry Neal (Inactive) added a comment -

          Samuel, please make this a priority since it is a 2.0 issue.

          Show
          jkneal Jerry Neal (Inactive) added a comment - Samuel, please make this a priority since it is a 2.0 issue.
          Hide
          samuel Samuel Holtzkampf (Inactive) added a comment -

          Had to add addLioneFields to getComponentsForLifecycle() in CollectionGroup to be able to see controls on add line fields. After that fix I could not reproduce the bug even when adding a date field control.

          Show
          samuel Samuel Holtzkampf (Inactive) added a comment - Had to add addLioneFields to getComponentsForLifecycle() in CollectionGroup to be able to see controls on add line fields. After that fix I could not reproduce the bug even when adding a date field control.
          Hide
          jkneal Jerry Neal (Inactive) added a comment -

          Samuel,

          I had to revert this change because I found that all lookup requests were broken. These result in this exception:

          java.lang.RuntimeException: Exception evaluating expression: #ViewHelper.allowsMaintenanceEditAction(#line) at org.kuali.rice.krad.uif.service.impl.ExpressionEvaluatorServiceImpl.evaluateExpression(ExpressionEvaluatorServiceImpl.java:118) at org.kuali.rice.krad.uif.service.impl.ExpressionEvaluatorServiceImpl.evaluatePropertyExpressions(ExpressionEvaluatorServiceImpl.java:220) at org.kuali.rice.krad.uif.service.impl.ExpressionEvaluatorServiceImpl.evaluateObjectExpressions(ExpressionEvaluatorServiceImpl.java:59) at org.kuali.rice.krad.uif.service.impl.ViewHelperServiceImpl.performComponentApplyModel(ViewHelperServiceImpl.java:660) at

          We'll have to take another look at this and figure out how to resolve the original issue in another way, or put in something to prevent this.

          jerry

          Show
          jkneal Jerry Neal (Inactive) added a comment - Samuel, I had to revert this change because I found that all lookup requests were broken. These result in this exception: java.lang.RuntimeException: Exception evaluating expression: #ViewHelper.allowsMaintenanceEditAction(#line) at org.kuali.rice.krad.uif.service.impl.ExpressionEvaluatorServiceImpl.evaluateExpression(ExpressionEvaluatorServiceImpl.java:118) at org.kuali.rice.krad.uif.service.impl.ExpressionEvaluatorServiceImpl.evaluatePropertyExpressions(ExpressionEvaluatorServiceImpl.java:220) at org.kuali.rice.krad.uif.service.impl.ExpressionEvaluatorServiceImpl.evaluateObjectExpressions(ExpressionEvaluatorServiceImpl.java:59) at org.kuali.rice.krad.uif.service.impl.ViewHelperServiceImpl.performComponentApplyModel(ViewHelperServiceImpl.java:660) at We'll have to take another look at this and figure out how to resolve the original issue in another way, or put in something to prevent this. jerry
          Hide
          jcoltrin Jessica Coltrin (Inactive) added a comment -

          Closing since these items are now in the release notes.

          Show
          jcoltrin Jessica Coltrin (Inactive) added a comment - Closing since these items are now in the release notes.

            People

            • Assignee:
              samuel Samuel Holtzkampf (Inactive)
              Reporter:
              jkneal Jerry Neal (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: