Uploaded image for project: 'Errai'
  1. Errai
  2. ERRAI-643

BindableProxyAgent.syncState must use converter when setting model's property value in InitialState.FROM_UI mode.

    Details

    • Steps to Reproduce:
      Hide

      Property type in model must be different from UI control.
      uiControl.setValue(...);
      dataBinder = DataBinder.forModel(m, InitialState.FROM_UI);
      dataBinder.bind(uiControl, "test", converter);

      Show
      Property type in model must be different from UI control. uiControl.setValue(...); dataBinder = DataBinder.forModel(m, InitialState.FROM_UI); dataBinder.bind(uiControl, "test", converter);
    • Workaround:
      Workaround Exists
    • Workaround Description:
      Hide

      dataBinder.bind() must be called before setting any values to UI, and then UI controls can be populated with needed values.

      Show
      dataBinder.bind() must be called before setting any values to UI, and then UI controls can be populated with needed values.

      Description

      Line 368 in errai-2.4.0.Final\errai-data-binding\src\main\java\org\jboss\errai\databinding\client\BindableProxyAgent.java:

      proxy.set(property, value);

      must be changed to something like this:

      Object newValue = toModelValue(propertyTypes.get(property).getType(), widget, value, converter);
      proxy.set(property, newValue);

      In current implementation UI values cannot be populated into model and raise exception, because converters are not called during initial bind() in InitialState.FROM_UI mode.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                csa Christian Sadilek
                Reporter:
                slavap Slava Pankov
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: