SetEditColumn Method (LISTVIEW)


 10.1B

 

The SetEditColumn method turns on HTML <input> editing for all of the column cells in a PWS LISTVIEW object. The method uses the following format:

 

[label]

{object}.SetEditColumn

[GIVING {return}] USING [*Index=]{index}:

 

 

[*Type=]{type][,*MaxChars=]{maxchars}[:

 

 

[*Class=]{class][,*List=]{list}[:

 

 

[*Flags=]{flags]

 

Where:

label

Optional. A Program Execution Label.

object

Required. A LISTVIEW object that has been previously created.

return

Optional. A Numeric Variable that indicates the pass or fail for the method.

index

Required. A decimal number or Numeric Variable that is the zero-based column number of the LISTVIEW being used.

type

Required. A decimal number or Numeric Variable that indicates the type of <input> to be applied to the column cells.

maxchars

Optional. A decimal number or Numeric Variable that indicates the maximum characters to be allowed by the HTML <input>.

class

Optional. A Character String Variable or literal that contains user CSS Class(es) to be applied to the HTML <input> object.

list

Optional. A Character String Variable or literal that that contains a list of data items separated by a semi-colon character.

flags

Optional. A decimal number or Numeric Variable that controls additional behaviors.

Flags Affected: EOS, OVER, ZERO

Note the following:

  1. See this Web link for a description of the <input> tag : https://www.w3schools.com/tags/tag_input.asp

  2. The ZERO flag is set if the returned value is zero indicating that the method executed successfully. Otherwise, the returned value is non-zero and the ZERO flag is set FALSE.

  3. The OVER flag is set if the {return} variable is too small to receive the numeric value.

  4. The EOS flag is always set to FALSE.

  5. The {type} value indicates the type of input expected for a ListView column cell. The following identifies the supported types:

  6.  

    Value

    Meaning

    0

    The ListView Column edit mode is turned off and the HTML <input> is removed from all of the cells in the column specified by the {index} value.

    1

    The ListView Column edit mode is turned on and the HTML <input> tag is rendered into each cell for the column specified by the {index} value. In HTML 'type' attribute for the <input> tag is set to be 'text'. In this case, all keyed characters are accepted.

    2

    The ListView Column edit mode is turned on and the HTML <input> tag is rendered into each cell for the specified by the {index} value. The HTML 'type' attribute for the <input> tag is set to be 'text'. However, in this case, the keyed characters for the <input> is limited to be numeric digits '0' to '9' inclusive.

     

     Warning: When using the numeric {type} value of 2, any {list} items longer than the {maxchars} limit may be stored as the cell value. This behavior depends on the browser operational behaviors.

    4

    The {maxchars} value sets the HTML <input> attribute 'maxlength' value. In this case, the {maxchars} value is iintended to limit the number of characters that can be keyed into a Listview column cell. This behavior is controlled by the browser being used. See this Web link for a description of the 'maxlength' <input> attribute:

     

    https://www.w3schools.com/tags/att_input_maxlength.asp

     

    Warning: When using the numeric {type} value of 2, any {list} items longer than the {maxchars} limit may be stored as the cell value. This behavior depends on the browser operational behaviors.

    5

    The {class} string parameter specifies a user custom 'class' that is to be applied to <input> class attribute. The default 'class' named 'plblvc' is automatically applied to the HTML <input>. The 'plblvc' class is found in the PWS 'http_root\plbwebbasic.css' file. When this parameter is used, the parameter {class} string replaces the default 'class'. Therefore, the {class} string can be specified using multiple 'class' names.

     

    Example of {class} string using multiple class names:

     

    *CLASS="plblvc lvcred"

     

    a. In this case, the 'plblvc' class exists in the 'http_root\plbwebbasic.css' file for the PWS.

     

    b. The 'lvcred' is a user custom class name to be applied. In this case, the 'lvcred' must be declared and exist in a CSS file. The CSS file can be loaded by a PWS server as follows:

     

    Use PLBWEB_USER={filename.css}.

     

    Use the 'Client.AddCss' method to load a user custom CSS file.

     

    See this link for a description of the 'class' HTML Global Attribute:

     

    https://www.w3schools.com/tags/ref_standardattributes.asp

    6

    The {list} string parameter specifies a list of items that are delimited using a semi-colon character. The {list} string data is rendered as a HTML <datalist> to the client browser and then referenced using the 'list' attribute. The control/presentation of the 'list' attribute is strictly controlled by a browser when the LISTVIEW cell has the focus in the edit mode. See the following Web link for more information on the 'list' attribute:

     

    https://www.w3schools.com/tags/att_input_list.asp

  7. The {flags} parameter is a bit-mask value that controls the behaviors of this method. This parameter is reserved for future use.

 

 

See Also: Method Syntax, LISTVIEW Methods

 



PL/B Language Reference SetColumnWidths Method (LISTVIEW) SetEditFocus (LISTVIEW)