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

MVVM Form Binding with References

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: 7.0.0, 6.5.5
    • Fix Version/s: 8.0.0
    • Component/s: Databind 2
    • Security Level: Jimmy
    • Labels:

      Description

      using ZK Bind references inside Formbinding, (depending on usage) bypasses the form buffer, or does not save at all
      see attached example:

      1. reference to propery does not get saved when the form is saved
      nameRef="@ref(fx.name)"
      <textbox value="@bind(nameRef)" /> <!-- value is not saved to the original object on "save" -->

      2. reference to member, and binding the member property on the reference bypasses the form buffer and updates the object outside the form directly
      mainTagRef="@ref(fx.mainTag)"
      <textbox value="@bind(mainTagRef.value)" /> <!-- saves directly bypassing the form buffer -->

        Activity

        Hide
        dennis dennis added a comment -

        [Diagnosis]
        Form binding doesn't handle the indirect access of a Form.
        (Same cause when handle collection , ZK-2078)

        In case 1, the Form doesn't know to save back to bean because the @bind(nameRef) expression in on reference, not on a form (no save-field information)
        (Form Save-field and Load_field are processed when parsing expression. At that moment , it might not have enough information to get the required information)

        In case 2, fx.mainTag (the target object instance) is load to reference mainTagRef (tag instance -> fx.mainTag -> mainTagRef).
        so, if we update the reference, it update to the bean directly.

        Show
        dennis dennis added a comment - [Diagnosis] Form binding doesn't handle the indirect access of a Form. (Same cause when handle collection , ZK-2078 ) In case 1, the Form doesn't know to save back to bean because the @bind(nameRef) expression in on reference, not on a form (no save-field information) (Form Save-field and Load_field are processed when parsing expression. At that moment , it might not have enough information to get the required information) In case 2, fx.mainTag (the target object instance) is load to reference mainTagRef (tag instance -> fx.mainTag -> mainTagRef). so, if we update the reference, it update to the bean directly.
        Hide
        jumperchen jumperchen added a comment -

        Bug fixed since 12/29/2014

        Show
        jumperchen jumperchen added a comment - Bug fixed since 12/29/2014

          People

          • Assignee:
            jumperchen jumperchen
            Reporter:
            cor3000 cor3000
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: