Child pages
  • Specification (.spec file)

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

controller.readOnly = true in the developer will set this boolean to a property called "readOnly" of a webcomponent, this property should be a runtime or even a hidden property. It should not be a design time property, because the system can set it at any time (to true or false). 

If you want also a design time property to control the editable state then add a second property, see example below, and then having a tag in the template like: ng-readonly="model.readOnly || !model.editable"

 

Code Block
languagejs
titleListening to readonly
"model" : {
  "readOnly": { "type":"protected", "blockingOn" : true, "default": false, "tags": {"scope":"runtime"}},
  "editable": { "type": "protected", "blockingOn": false, "default": true }
}

 

With this property a component can do its thing to set or unset the readonly mode for itself.

It's better to have type this property as "protected" because it should only be able to change at the server, never from the client.

See as an example our bootstrap textbox: https://github.com/Servoy/bootstrapcomponents/tree/master/textbox

 

Findmode is a special type: Findmode property type which can be used to set all kind of other properties which are normally protected from changing on the client side. Or you can just use it as a type for any property you want: 

...