FormLayout.getDataFieldUsage method
getDataFieldUsage
DataFieldUsage getDataFieldUsage(String dataFieldName) throws TFormerException
Referenced types: DataFieldUsage
Retrieves the usage of a specific DataField in a FormLayout.
Parameters
| Parameter / type | Description |
|---|---|
dataFieldNameString |
Name of the DataField to be queried |
Returns
A valid object instance or null
See also
Sample: To query all DataField-objects within a stand-alone FormLayout refer to the code below. The same principle can be used for a Repository-based FormLayout.
// Retrieve the global Project
// A stand-alone FormLayout contains only the global Project, the global Project holds the FormLayout and all DataField definitions
Project project = repository.getGlobalProject ();
// Retrieve the one and only FormLayout within the stand-alone FormLayout
FormLayout formlayout = project.getFirstFormLayout ();
// Iterate all DataFields within the Project
DataField datafield = project.getFirstDataField ();
while (datafield != null)
{
System.out.println (datafield.toString());
// Retrieve the usage of the DataFields in the FormLayout
switch (formlayout.getDataFieldUsage (datafield.getName ()))
{
case Calculated: System.out.println ("--> The value of this DataField is computed within the FormLayout"); break;
case Invalid : System.out.println ("--> Invalid usage - contact TEC-IT"); break;
case Normal : System.out.println ("--> The DataField is used within the FormLayout; its value can be set"); break;
case NotUsed : System.out.println ("--> This DataField is not used in this FormLayout"); break;
case Parameter : System.out.println ("--> This is a system DataField (like the page number) used within the FormLayout"); break;
}
datafield = datafield.getNext ();
}