FredTek

Using Display Field Names

The JavaDoc for the getDisplayField method hints at the difference between

         getDisplayField ("MyFieldName")

and

         getDisplayField ("*MyFieldName")

Use the former for display fields that are associated with a single value at or below the top level of the page. Use the latter for display fields that are associated with multiple values or are not directly below the top level of the page.

So, what does that mean? Let's look at the following 'tree' which represents the composition of the a sample page:

  • pg_Example
    • btn_test
    • lb_MyList
    • rpt_Repeated
      • st_Field1
      • st_Field2

Using this example, the following would be the appropriate names to use when attempting to access the display field:

Visual Object Correct Name Reason
pg_Example "pg_Example" at the top level of the page
btn_test "btn_test" below the top level, not repeated on the page
lb_MyList "*lb_MyList" multiple values may be assigned to it (as in multi-select list boxes)
rpt_Repeat "rpt_Repeat" Directly under the top level of the page. No values returned from it.
st_Field1 "*st_Field1" under the level of repeated thus, not under top level
Note:

These rules apply to any place where the name of the display field may be used as a String, i.e. getDisplayField, getDisplayFieldValue, setDisplayFieldValue, etc.