Kuali Rice Development
  1. Kuali Rice Development
  2. KULRICE-12402

2.4.0 CDT: Server Side Paging table - Invalid data wiped on add row with no warning

    Details

    • Type: Task Task
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.5.1
    • Component/s: Development
    • Security Level: Public (Public: Anyone can view)
    • Labels:
      None
    • Similar issues:
      KULRICE-10109Continue Server Side Paging Work - Column/Row Span
      KULRICE-10916Sorting is broken for tables using server side paging
      KULRICE-11945Actions column header disappears with server side paging
      KULRICE-11935Library Collections Lookup sample (server side paging) has no rows returned
      KULRICE-124002.4.0 CDT: Sorting not working on add line in collection
      KULRICE-10534Multivalue lookup server side select for server side paging
      KULRICE-10977Multi Value Lookup : Implement server side paging for both rich and non rich tables when data selected is not on current page
      KULRICE-12963Table page gets built twice initially when server side paging is enabled
      KULRICE-10267Server side paged collections - add line enhancement/fix
      KULRICE-11071KRAD Demo Library Collection Features Server Paging Stacked Collection with server-side paging and Table Collection with server-side Paging not paging
    • Rice Team:
      Framework
    • Sprint:
      Framework 2.5.1 Sprint 3
    • KAI Review Status:
      Not Required
    • KTI Review Status:
      Not Required
    • Code Review Status:
      Not Required
    • Include in Release Notes?:
      Yes
    • Story Points:
      5

      Description

      KRAD - Library - Collections - Server Paging - character placement (abc) in field 3 (rating) is not added when row is added and no error/warning

        Issue Links

          Activity

          Hide
          Kristina Taylor (Inactive) added a comment - - edited

          Well, at least in 2.5 it errors out, just really badly...

          org.springframework.validation.BindException: org.kuali.rice.krad.web.bind.UifBeanPropertyBindingResult: 1 errors
          Field error in object 'KualiForm' on field 'newCollectionLines[collection1].doubleField': rejected value [abc]; codes [typeMismatch.KualiForm.newCollectionLines[collection1].doubleField,typeMismatch.KualiForm.newCollectionLines.doubleField,typeMismatch.newCollectionLines[collection1].doubleField,typeMismatch.newCollectionLines.doubleField,typeMismatch.doubleField,typeMismatch.java.math.BigDecimal,typeMismatch]; arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [KualiForm.newCollectionLines[collection1].doubleField,newCollectionLines[collection1].doubleField]; arguments []; default message [newCollectionLines[collection1].doubleField]]; default message [Failed to convert property value of type 'java.lang.String' to required type 'java.math.BigDecimal' for property 'newCollectionLines[collection1].doubleField'; nested exception is java.lang.IllegalArgumentException: Could not parse number: Unparseable number: "abc"]
          at org.kuali.rice.krad.web.controller.UifDefaultFormMethodArgumentResolver.resolveArgument(UifDefaultFormMethodArgumentResolver.java:82)
          at org.springframework.web.method.support.HandlerMethodArgumentResolverComposite.resolveArgument(HandlerMethodArgumentResolverComposite.java:77)
          at org.springframework.web.method.support.InvocableHandlerMethod.getMethodArgumentValues(InvocableHandlerMethod.java:157)
          at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:124)
          at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)
          at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:745)
          at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:685)
          at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80)
          at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:919)
          at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:851)
          at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:953)
          at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:855)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
          at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:829)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
          at org.kuali.rice.krad.web.filter.CharsetFilter.doFilter(CharsetFilter.java:58)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
          at org.kuali.rice.krad.web.filter.UserLoginFilter.doFilter(UserLoginFilter.java:89)
          at org.kuali.rice.krad.web.filter.UserLoginFilter.doFilter(UserLoginFilter.java:77)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
          at org.kuali.rice.krad.web.filter.BootstrapFilterChain.doFilter(BootstrapFilter.java:327)
          at org.kuali.rice.krad.web.filter.DummyLoginFilter.doFilter(DummyLoginFilter.java:82)
          at org.kuali.rice.krad.web.filter.DummyLoginFilter.doFilter(DummyLoginFilter.java:62)
          at org.kuali.rice.krad.web.filter.BootstrapFilterChain.doFilter(BootstrapFilter.java:320)
          at org.kuali.rice.krad.web.filter.BootstrapFilter.doFilter(BootstrapFilter.java:199)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
          at org.kuali.rice.krad.web.filter.UifSessionTimeoutFilter.doFilter(UifSessionTimeoutFilter.java:130)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
          at org.kuali.rice.core.web.Log4JContextClearingFilter.doFilterInternal(Log4JContextClearingFilter.java:37)
          at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:106)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
          at org.kuali.rice.krad.web.filter.HideWebInfFilter.doFilter(HideWebInfFilter.java:68)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
          at org.springframework.web.filter.AbstractRequestLoggingFilter.doFilterInternal(AbstractRequestLoggingFilter.java:214)
          at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:106)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
          at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
          at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
          at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
          at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579)
          at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:307)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
          at java.lang.Thread.run(Thread.java:722)
          
          Show
          Kristina Taylor (Inactive) added a comment - - edited Well, at least in 2.5 it errors out, just really badly... org.springframework.validation.BindException: org.kuali.rice.krad.web.bind.UifBeanPropertyBindingResult: 1 errors Field error in object 'KualiForm' on field 'newCollectionLines[collection1].doubleField': rejected value [abc]; codes [typeMismatch.KualiForm.newCollectionLines[collection1].doubleField,typeMismatch.KualiForm.newCollectionLines.doubleField,typeMismatch.newCollectionLines[collection1].doubleField,typeMismatch.newCollectionLines.doubleField,typeMismatch.doubleField,typeMismatch.java.math.BigDecimal,typeMismatch]; arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [KualiForm.newCollectionLines[collection1].doubleField,newCollectionLines[collection1].doubleField]; arguments []; default message [newCollectionLines[collection1].doubleField]]; default message [Failed to convert property value of type 'java.lang. String ' to required type 'java.math.BigDecimal' for property 'newCollectionLines[collection1].doubleField'; nested exception is java.lang.IllegalArgumentException: Could not parse number: Unparseable number: "abc"] at org.kuali.rice.krad.web.controller.UifDefaultFormMethodArgumentResolver.resolveArgument(UifDefaultFormMethodArgumentResolver.java:82) at org.springframework.web.method.support.HandlerMethodArgumentResolverComposite.resolveArgument(HandlerMethodArgumentResolverComposite.java:77) at org.springframework.web.method.support.InvocableHandlerMethod.getMethodArgumentValues(InvocableHandlerMethod.java:157) at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:124) at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:745) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:685) at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:919) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:851) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:953) at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:855) at javax.servlet.http.HttpServlet.service(HttpServlet.java:641) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:829) at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.kuali.rice.krad.web.filter.CharsetFilter.doFilter(CharsetFilter.java:58) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.kuali.rice.krad.web.filter.UserLoginFilter.doFilter(UserLoginFilter.java:89) at org.kuali.rice.krad.web.filter.UserLoginFilter.doFilter(UserLoginFilter.java:77) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.kuali.rice.krad.web.filter.BootstrapFilterChain.doFilter(BootstrapFilter.java:327) at org.kuali.rice.krad.web.filter.DummyLoginFilter.doFilter(DummyLoginFilter.java:82) at org.kuali.rice.krad.web.filter.DummyLoginFilter.doFilter(DummyLoginFilter.java:62) at org.kuali.rice.krad.web.filter.BootstrapFilterChain.doFilter(BootstrapFilter.java:320) at org.kuali.rice.krad.web.filter.BootstrapFilter.doFilter(BootstrapFilter.java:199) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.kuali.rice.krad.web.filter.UifSessionTimeoutFilter.doFilter(UifSessionTimeoutFilter.java:130) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.kuali.rice.core.web.Log4JContextClearingFilter.doFilterInternal(Log4JContextClearingFilter.java:37) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:106) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.kuali.rice.krad.web.filter.HideWebInfFilter.doFilter(HideWebInfFilter.java:68) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.springframework.web.filter.AbstractRequestLoggingFilter.doFilterInternal(AbstractRequestLoggingFilter.java:214) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:106) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:307) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang. Thread .run( Thread .java:722)
          Hide
          Kristina Taylor (Inactive) added a comment - - edited

          I tried adding validation to this. It worked as long as it wasn't a Rich Table. When it was a Rich Table, I received a browser popup telling me that the JSON was invalid. The problem is that the JSON has some invalid characters in it that we are trying to escape for normal HTML processing.

          This is what is produced when we add the validation to the fields and have layoutManager.richTable.render set to true:

          value=\"jQuery(document).ready(function(e) {\nrunValidationScript(function(){\njQuery.validator.addMethod("validChar-newCollectionLines[\'collection1\'].integerField0", function(value, element) {\n return this.optional(element) || /^(([1-9][0-9]*)|[0]*)$/.test(value);}, "Must be a non-negative whole number");});});\" />"
          

          The issue is somewhere around ClientValidationUtils.getRegexMethod. Notice that when it outputs the validChar-newCollectionLines['collection1'].integerField0 that it will escape the single quote. While this is fine in JavaScript, it does not parse in JSON because JSON sees the single quote as a normal character, not as a quote. If you replace ScriptUtils.escapeName(key) with just key then the page renders fine.

          I'm not sure how many people use the Rich Table and validation together, so this seems like it could be a larger bug. I'm thinking we will need to pass this to Brian since he did the original validation work and knows a lot about this.

          Show
          Kristina Taylor (Inactive) added a comment - - edited I tried adding validation to this. It worked as long as it wasn't a Rich Table. When it was a Rich Table, I received a browser popup telling me that the JSON was invalid. The problem is that the JSON has some invalid characters in it that we are trying to escape for normal HTML processing. This is what is produced when we add the validation to the fields and have layoutManager.richTable.render set to true: value=\ "jQuery(document).ready(function(e) {\nrunValidationScript(function(){\njQuery.validator.addMethod("validChar-newCollectionLines[\'collection1\'].integerField0", function(value, element) {\n return this .optional(element) || /^(([1-9][0-9]*)|[0]*)$/.test(value);}, "Must be a non-negative whole number");});});\" />" The issue is somewhere around ClientValidationUtils.getRegexMethod . Notice that when it outputs the validChar-newCollectionLines ['collection1'] .integerField0 that it will escape the single quote. While this is fine in JavaScript, it does not parse in JSON because JSON sees the single quote as a normal character, not as a quote. If you replace ScriptUtils.escapeName(key) with just key then the page renders fine. I'm not sure how many people use the Rich Table and validation together, so this seems like it could be a larger bug. I'm thinking we will need to pass this to Brian since he did the original validation work and knows a lot about this.
          Hide
          Nisha Gupta (Inactive) added a comment -

          I implemented a fix for this that is similar to https://jira.kuali.org/browse/KULRICE-13870 (bind exceptions). I extended it to even line actions cause the problem exists even there. However, Kristina's comments about for the ClientValidationUtils.getRegexMethod still exists. I have created a new JIRA for it https://jira.kuali.org/browse/KULRICE-13984.

          Show
          Nisha Gupta (Inactive) added a comment - I implemented a fix for this that is similar to https://jira.kuali.org/browse/KULRICE-13870 (bind exceptions). I extended it to even line actions cause the problem exists even there. However, Kristina's comments about for the ClientValidationUtils.getRegexMethod still exists. I have created a new JIRA for it https://jira.kuali.org/browse/KULRICE-13984 .
          Hide
          Martin Taylor (Inactive) added a comment -

          Closing 2.5.1 Development

          Show
          Martin Taylor (Inactive) added a comment - Closing 2.5.1 Development

            People

            • Assignee:
              Nisha Gupta (Inactive)
              Reporter:
              Martin Taylor (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Agile

                  Structure Helper Panel