Making attached component editable

where are you calling this code (in a function, constructor, etc)?