Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 3 Tasks : Customizing the Form’s Preview Data

Customizing the Form’s Preview Data
By default, when a form is previewed, sample data is included for each control to give a better idea of how the form will appear to a user at runtime. This section explains how to customize the preview data that appears, rather than using the default data generated for each control type.
Editing the File [form-name].data.json
To customize the preview data for a form:
1.
In the Project Explorer, find the file that contains the preview data. The default location of this file is: [project-name] > Forms > ProcessPackage > [business-process-name] > [user-task-name] > [form-name].data.json
2.
Right-click the .data.json file and click Copy. Then, in the same location in the Project Explorer, right-click and click Paste. The Name Conflict dialog will appear asking you to type a new name for the file. Keep the extension .data.json, and supply a different filename. Do not delete the original preview data file.
3.
Do not edit the original .data.json file. This is a generated file, and if you edit it, your customizations will be overwritten when the file is regenerated.
Also, be sure to maintain the file extension, .data.json. Otherwise, you’re customized preview data file will not be accessible by the form.
4.
Example of Default Preview Data File
{ items: [
   { $param:'AnotherDemo', $value: {$type:'com.example.demo.Demo',    normalText: "normalText" ,list:[
   "list"
   ],duration: "" ,attribute1:[
   "2010-05-16"
   ]}
   },
   { $param:'Demo', $value: {$type:'com.example.demo.Demo',    normalText: "normalText" ,list:[
   "list"
   ],duration: "" ,attribute1:[
   "2010-05-16"
   ]}
   }
   ]}
Example of Customized Preview Data File
{ items: [
   { $param:'AnotherDemo', $value: {$type:'com.example.demo.Demo',
   normalText: "My Sample Data" ,
   list:["list", "John", "George", "Ringo"],
   duration: "P4Y" ,
   attribute1:["2010-05-07", "2010-02-11"]}
   },
   { $param:'Demo', $value: {$type:'com.example.demo.Demo',
      normalText: "normalText", list:["list"],duration: "",
      attribute1:["2010-05-07"]}
   }
]}
Configure the Setting in the Properties View
Once you have created a custom preview data file, you can configure the form to use this file rather than the default file (or no file at all) for preview data.
To configure the Preview Data File setting for the form:
1.
2.
a.
None Select this option if you prefer that no data be displayed initially for the controls when the form is previewed.
b.
Default Select this option if you want to use the default data for each control on the form.
c.
Custom Select this option if you want to use your customized .data.json file for the preview data values. The Custom radio button is paired with an optionlist that shows all the .data.json files associated with the current form. Select the custom preview data file you want to use from the optionlist.

Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved