Dataset rows in custom property of template

I’m using dataset as custom property in template and binary values in dataset will change visibility of text fields in template.
But when I create a child in new window, dataset gets flush out totally.

Is there any way to retain assign column and rows from dataset?

Attached is the picture of parent and child.

Doesn’t look like you have that property bound to anything. Are you doing anything in scripting that may accidentally be writing over that instance of the template?

1 Like

Hello Bvaldovinos,

The property i’m talking about is “Appearance”. It’s template parameter (not an internal property) so I don’t get option to bind this property in template. I can bind it in child.
So “Appearance” is dataset and I manually added values in it. But when i create a child, value from property gets deleted.

I added small script to populate this parameter every time I create a child. This is only solution I got.

Would you mind exporting your project and posting it here?

I have attached the test project.Test_2019-02-08_0959.proj (96.3 KB)

1 Like

Hey @kunal.ghule . I don’t see the same issues that you do. But since this is only a portion of the project, I get a lot of errors.

What helps me in situations like this is to log/print items. I changed the script on Templates/Data Faceplate to this:

logger = system.util.getLogger("Data Faceplate")
startLogging = True

if event.propertyName == "event.source.Label_name":
  headers = ["I/P Field", "Visible"]
  data = []
  data.append(["Measure", 0, "°F"])
  data.append(["Set Point", 0 ,"°F"])
  data.append(["Float", 0,"°F"])
  data.append(["Output", 0,"°F"])
  if startLogging:
  	logger.info("Appearance prior to update: %s" % (event.source.Appearance))
  event.source.Appearance = system.dataset.toDataSet(headers, data)
  if startLogging:
  	logger.info("Appearance after update: %s" % (event.source.Appearance))

Now I can quickly enable and disable logging with the variable at the top of the script. Sometimes I’ll bind that to a tag/button during development.

On your template definition of Data Faceplate, I see the parameter Appearance has [5R x 3C]. On your window Dryer 1 - Control Loops screen 1, I see Data Faceplate 49 has Appearance as [5R x 3C].