Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-4146

form set to dirty if a save binding point to same bean as a previous load binding

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: 8.6.0
    • Fix Version/s: 8.6.1
    • Component/s: None
    • Security Level: Jimmy
    • Labels:
      None

      Description

      Steps to Reproduce

      -http://zkfiddle.org/sample/j0qqoa/1-formdirty-save-from-two-references-
      updated fiddle:
      http://zkfiddle.org/sample/j0qqoa/4-formdirty-save-from-two-references

      Run fiddle
      Click on btn to add the save binding to the page
      (Note: this also happen in the same execution if the save binding is initialized inside a childrenBinding or a parameterized shadow element, which are processed later than the initial page processing)

      Current Result

      During init, the @load binding targeting a member of a form binding fires and goes through AstValue.getValue()
      This result in a call to BindElResolverEx.getValue(), then to BindElResolver.saveEqualBeans()
      Save equal beans will find existing save bindings for the same object.

      If a @save binding indirectly exists for the same object (ex: inside a shadow element, or a children binding), the @save binding will fire and set the form status to dirty

      Expected Result

      form should not be set to dirty during initialization.

      Debug Info

      BeanProxyHandler<T>.addDirtyField(String) line: 82	
      BeanProxyHandler<T>.invoke(Object, Method, Method, Object[]) line: 216	
      DataBean_$$_jvstbf6_1.setChecked(boolean) line: not available	
      GeneratedMethodAccessor10.invoke(Object, Object[]) line: not available	
      DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: not available	
      Method.invoke(Object, Object...) line: not available	
      BeanELResolver.setValue(ELContext, Object, Object, Object) line: 138	
      CompositeELResolver.setValue(ELContext, Object, Object, Object) line: 125	
      CompositeELResolver.setValue(ELContext, Object, Object, Object) line: 125	
      BindELResolverEx(XelELResolver).setValue(ELContext, Object, Object, Object) line: 155	
      BindELResolverEx(BindELResolver).saveEqualBeans(ELContext, Object, String, Object) line: 237	
      BindELResolverEx(BindELResolver).tieValue(ELContext, Object, Object, Object, boolean) line: 288	
      BindELResolverEx.tieValue(ELContext, Object, Object, Object, boolean) line: 143	
      BindELResolverEx(BindELResolver).getValue(ELContext, Object, Object) line: 150	
      AstValue.getValue(EvaluationContext) line: 188	
      ValueExpressionImplEx(ValueExpressionImpl).getValue(ELContext) line: 184	
      ValueExpressionImplEx.getValue(ELContext) line: 52	
      BindXelExpressionEx(ELXelExpression).evaluate(XelContext) line: 41	
      BindEvaluatorXImplEx$LazyBindXelExpression.evaluate(XelContext) line: 124	
      BindEvaluatorXImplEx.parseExpressionX(BindContext, String, Class<?>) line: 210	
      AccessInfo.create(Binding, String, Class<?>, ConditionType, String, boolean) line: 76	
      SavePropertyBindingImpl(PropertyBindingImpl).<init>(Binder, Component, String, String, String, ConditionType, String, Map<String,Object>, String, Map<String,Object>) line: 67	
      SavePropertyBindingImpl.<init>(Binder, Component, String, String, String, ConditionType, String, Map<String,Object>, String, Map<String,Object>, String, Map<String,Object>) line: 56	
      AnnotateBinderEx(BinderImpl).newSavePropertyBinding(Component, String, String, String, ConditionType, String, Map<String,Object>, String, Map<String,Object>, String, Map<String,Object>) line: 1041	
      AnnotateBinderEx(BinderImpl).addPropertySaveBindings0(Component, String, String, String[], String[], Map<String,Object>, String, Map<String,Object>, String, Map<String,Object>) line: 1244	
      AnnotateBinderEx(BinderImpl).addPropertySaveBindings(Component, String, String, String[], String[], Map<String,Object>, String, Map<String,Object>, String, Map<String,Object>) line: 910	
      AnnotateBinderHelper.processPropertySaveBindings(Component, String, Annotation, AnnotateBinderHelper$ExpressionAnnoInfo, AnnotateBinderHelper$ExpressionAnnoInfo) line: 481	
      AnnotateBinderHelper.processPropertyBindings(Component, String) line: 271	
      
      

      Root Cause

      SaveEqualBeans triggers on form object during init unexpectedly

      Workaround

        Attachments

          Activity

            People

            • Assignee:
              DevChu DevChu
              Reporter:
              MDuchemin MDuchemin
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: