U4-2947 - Fix complex property editors with $watch expressions

Created by Shannon Deminick 26 Sep 2013, 02:50:37 Updated by Shannon Deminick 02 Oct 2013, 09:15:26

Relates to: U4-2950

Subtask of: U4-2891

Any property editor that create's it's own scope custom model to give to it's view to render must have a $watch like:

$scope.$watch("model.value", function (newVal, oldVal) {
   if (newVal !== null && newVal !== undefined && newVal !== oldVal) {
        //update the display val again
        //$scope.renderModel = .....
    }
});

This is mandatory for two reasons:

  • If the server updates the model.value - this can occur for certain property editors like upload controls, etc...
  • --If there are multiple editors working on the same content item at the same time - if we don't have this then the current editor will not see the updated changes.--

From the looks of it we need to update property editors like: urllist, mediapicker, listview, googlemaps, folderbrowser, contentpicker, checkboxlist, boolean

Comments

Shannon Deminick 26 Sep 2013, 02:53:44

I've completed the urlpicker


Shannon Deminick 30 Sep 2013, 10:32:12

After chatting with Per we are going to do this by simple events. If you declare a function on your $scope.model.onValueChanged then it will execute when the server value has changed.

like:

    $scope.model.onValueChanged = function(newVal, oldVal) {
        //update the display val again
        formatDisplayValue();
    };


Priority: Normal

Type: Task

State: Fixed

Assignee: Shannon Deminick

Difficulty: Normal

Category:

Backwards Compatible: True

Fix Submitted:

Affected versions:

Due in version: 7.0.0

Sprint:

Story Points:

Cycle: