Skip to content

string properties cannot be read-only #189

@rmadsen-ks

Description

@rmadsen-ks

The following code should produce a read-only string, but it can be edited:

    @property(String)
    @attribute(Browsable(True))
    def ReadOnlyString(self):
        return "Read-only string!"
    

In KS8400 it looks like this:

image

A workaround can be done by using the EnabledIf attribute:

    @property(String)
    @attribute(Browsable(True))
    @attribute(EnabledIf("IsReadOnly", True))
    def ReadOnlyString(self):
        return "Read-only string!"
    
    @property(Boolean)
    @attribute(Browsable(False))
    def StringIsReadOnly(self):
        return False

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions