2

I'm following the tutorial here. I created my data class and added a name property using the wizard. I then created a zen form using the wizard, during which I selected the data class created above. Everything worked great. However, I went back and added an additional property, longName to my data class. Now, since it's over 300 lines of generated code I am assuming there is some way to regenerate it based on the updated class but I cannot figure out how.

I did end up copying the line below from the XData Contents section and modifying the values. It seems to work well but my question remains, is there some way to regenerate the form based on the updated class?

<text id="Name"  label="Name *" title="Enter a value" size="50" dataBinding="Name" height="23" />

1 Answers1

2

Can you point to exact part of tutorial? Is it Zen Form Wizard? If so just regenerate the form class (you don't need to delete it beforehand).

UPD. As you use Zen Form Wizard, you can call it programmatically via:

do ##class(%ZEN.Template.ZENFormWizard).CreatePage(dataClassName, appName, pkgName, newClassName, formName, cssNames, clsComment)

rfg
  • 1,331
  • 1
  • 8
  • 24
  • Yes, that's the step I meant, sorry. Deleting and regenerating is fine if I haven't modified any styles or layout or anything. What if I have? –  Jan 12 '16 at 21:01
  • Oh that's interesting, so I could pass a CSS file somehow to style the page even though it's basically rendered on the fly? –  Jan 12 '16 at 21:12
  • 1
    @DevilsAdvocate you can separate classes I guess. Have one generated form class, and another class extending this generated form which contains only your modifications. This way you can safely regenerate the base form without losing your changes. – rfg Jan 12 '16 at 21:14
  • @DevilsAdvocate cssNames sets [CSSINCLUDES](http://docs.intersystems.com/cache20152/csp/docbook/DocBook.UI.Page.cls?KEY=GZAP_page_really_programming#GZAP_C195912) parameter of ZEN Page – rfg Jan 12 '16 at 21:16
  • It's too bad Studio doesn't have something built in to update the generated form, but this is a cool alternative. Thanks. –  Jan 12 '16 at 21:17