Understanding List Forms

The following information provides background information about the internals of CA SDM list forms. We recommend that you use the Web Screen Painter Design View to modify these forms.
casm1401
The following information provides background information about the internals of CA SDM list forms. We recommend that you use the Web Screen Painter Design View to modify these forms.
CA SDM list forms are defined with the following macros (invoked with the PDM_MACRO tag):
  • lsStart
    Begins a list
  • lsCol
    Defines a column in a list
  • lsWrite
    Inserts text into the pdm_list part of a list
  • lsEnd
    Ends a list
The general form of a list using these macros is the following:
<pdm_macro name=lsStart> <pdm_macro name=lsCol hdr=hdr1 attr=attr1> <pdm_macro name=lsCol hdr=hdr1 attr=attr1> <pdm_macro name=lsEnd>
This results in text similar to the following example in the output HTML:
var rs = new Resultset(); From lsStart rs.startList(); From lsStart rs.header("hdr1"); From lsCol rs.setData("attr1","options"); From lsCol rs.header("hdr2"); From lsCol rs.setData("attr2","options"); From lsCol <PDM_LIST SOURCE=list> From lsEnd rs.data(attr1) From lsCol/lsEnd rs.data(attr2) From lsCol/lsEnd </PDM_LIST> From lsEnd
There are two distinct sections to the output list: the setup section before the <PDM_LIST> tag, and the actual list between the <PDM_LIST> and </PDM_LIST> tags. The lsCol macro makes use of preprocessor variables and the <PDM_SET> tag to output data to both sections of the list. The entire list section of the list is created by a <PDM_EVAL> tag generated by the lsEnd macro.
To insert your own JavaScript in the setup section of the list, simply include it where needed. Use the lsWrite macro to insert your own code into the list section of the list.
The lsWrite Macro
The lsWrite macro specifies text for the list section of a list (the portion between the <pdm_list> and the </pdm_list> tags). Text specified for the text argument of this macro is deferred, and not written to the output HTML until the lsEnd macro.
lsWrite [both=no|yes]
text=”xxx”
  • both
    Specifies that the text operand is to be written both immediately to the output HTML and to the deferred text buffer. This can be useful to output JavaScript to conditionally bypass both the setup and the list information output by a subsequent lsCol macro. Optional; defaults to no.
  • text
    Specifies the text generated by this macro. Text specified is deferred until the lsEnd macro.
It is often desirable to include pdm tags and references to form variables in the text output by an lsWrite macro. To prevent these from being interpreted by the web engine during parsing of the lsWrite macro itself, follow these syntax rules:
  • If the lsWrite macro generates a pdm_tag, omit the surrounding “<” and “>” delimiters of the tag. For example, to insert a <pdm_else> statement into the list section of the list, code:
    <PDM_MACRO NAME=lsWrite text="pdm_else">
    The web engine automatically inserts the “<” and “>” before producing the text when it detects that the first four characters are “pdm_” (or “PDM_”).
  • If the lsWrite macro generates a reference to a form variable, code an @ character in place of the $ character that designates the variable. For example, to generate a reference to the list variable $list.persistent_id, code:
    <PDM_MACRO NAME=lsWrite text="@list.persistent_id">
    The web engine automatically converts the “@” to “$” before producing the text. To produce a literal @ sign, precede it with a backslash.