diff --git a/example/forms/res/templates/exampleForm.html b/example/forms/res/templates/exampleForm.html index 70c65f3ab4..2360b0df97 100644 --- a/example/forms/res/templates/exampleForm.html +++ b/example/forms/res/templates/exampleForm.html @@ -1,4 +1,7 @@
+ + + diff --git a/example/forms/src/ExampleFormController.js b/example/forms/src/ExampleFormController.js index fd71122085..5534d26459 100644 --- a/example/forms/src/ExampleFormController.js +++ b/example/forms/src/ExampleFormController.js @@ -1,4 +1,4 @@ -/*global define*/ +/*global define,window*/ define( [], @@ -10,6 +10,89 @@ define( }; + $scope.toolbar = { + name: "An example toolbar.", + sections: [ + { + description: "First section", + items: [ + { + name: "X", + description: "X coordinate", + control: "textfield", + pattern: "^\\d+$", + disabled: true, + size: 2, + key: "x" + }, + { + name: "Y", + description: "Y coordinate", + control: "textfield", + pattern: "^\\d+$", + size: 2, + key: "y" + }, + { + name: "W", + description: "Cell width", + control: "textfield", + pattern: "^\\d+$", + size: 2, + key: "w" + }, + { + name: "H", + description: "Cell height", + control: "textfield", + pattern: "^\\d+$", + size: 2, + key: "h" + } + + ] + }, + { + description: "Second section", + items: [ + { + control: "button", + glyph: "1", + description: "Button A", + click: function () { + window.alert("A"); + } + }, + { + control: "button", + glyph: "2", + description: "Button B", + click: function () { + window.alert("B"); + } + }, + { + control: "button", + glyph: "3", + description: "Button C", + disabled: true, + click: function () { + window.alert("C"); + } + } + ] + }, + { + items: [ + { + control: "color", + key: "color" + } + ] + } + ] + }; + $scope.form = { name: "An example form.", sections: [ diff --git a/platform/commonUI/browse/res/templates/browse-object.html b/platform/commonUI/browse/res/templates/browse-object.html index ecd91b71c4..a65a6c6a3a 100644 --- a/platform/commonUI/browse/res/templates/browse-object.html +++ b/platform/commonUI/browse/res/templates/browse-object.html @@ -23,7 +23,7 @@
+ mct-object="representation.selected.key && domainObject">
\ No newline at end of file diff --git a/platform/commonUI/edit/src/EditRepresenter.js b/platform/commonUI/edit/src/EditRepresenter.js index 6cf40aadd2..bf3dfc721b 100644 --- a/platform/commonUI/edit/src/EditRepresenter.js +++ b/platform/commonUI/edit/src/EditRepresenter.js @@ -73,7 +73,7 @@ define( // Handle a specific representation of a specific domain object function represent(representation, representedObject) { // Track the key, to know which view configuration to save to. - key = representation.key; + key = (representation || {}).key; // Track the represented object domainObject = representedObject; diff --git a/platform/commonUI/general/res/templates/tree.html b/platform/commonUI/general/res/templates/tree.html index 46a3259634..92eb25ef7a 100644 --- a/platform/commonUI/general/res/templates/tree.html +++ b/platform/commonUI/general/res/templates/tree.html @@ -1,4 +1,10 @@