I have a data entry page with several Dropdown and Text Fields. Is there a simpler way to clear all to "" / null value?
Can make a button "Clear" and script, but was wondering if there was any other way to do this that doesn't require as much setup / adaptable to changes in page layout
self.parent.getChild("TabContainer").getChild("General").getChild("Tag Name").getChild("Data").props.text = ''
self.parent.getChild("TabContainer").getChild("General").getChild("Description").getChild("Data").props.text = ''
Use a view custom property for every entry field's value, bidirectionally bound. Perhaps as a nested object.
Then your script just assigns to self.view.custom.whatever
, no component retrieval at all. If you use a nested object, then you can use a single assignment with a dictionary of empty values.
self.view.custom.fields = {'tagName': '', 'description': ''}
(All of your scripts would use the view custom props, making your entry form component nesting completely free-form--no need to ever fix scripts when you restructure your view.)