Pattern Field

From Apache OpenOffice Wiki
Jump to: navigation, search

The pattern field control displays and enters a string according to a specified pattern. The entries that the user enters in the pattern field are defined in the EditMask property as a special character code. The length of the edit mask determines the number of the possible input positions. If a character is entered that does not correspond to the edit mask, the input is rejected. For example, in the edit mask "NNLNNLLLLL" the character L has the meaning of a text constant and the character N means that only the digits 0 to 9 can be entered. A complete list of valid characters can be found in the Apache OpenOffice online help. The LiteralMask property contains the initial values that are displayed in the pattern field. The length of the literal mask should always correspond to the length of the edit mask. An example of a literal mask which fits to the above mentioned edit mask would be "__.__.2002". In this case, the user enters only 4 digits when entering a date.

  oPatternFieldModel = oDialog.Model.PatternField1
  oPatternFieldModel.EditMask = "NNLNNLLLLL"
  oPatternFieldModel.LiteralMask = "__.__.2002"

More information at: Documentation/OOo3_User_Guides/Writer_Guide/Form_controls_reference_Pattern_field

Content on this page is licensed under the Public Documentation License (PDL).
Personal tools
In other languages