Summary

LANSA Web Functions

Summary

Important Observations

  • In this example, the data apportionment fields were only defined as 20 characters. In your applications, your fields could be much larger (up to 256 characters).
  • Data apportionment provides a solution to the 256 character field limitation by parsing the data into a grouping of related fields. A user could enter 500 characters of text which cannot be stored in a single LANSA field. Using data apportionment, the text can be stored in two fields.
  • In this example, the fields were simply written back out to the screen to show you how the data apportionment is performed. In your application, these fields might be written to a database file.

Tips & Techniques

  • The fields used for the data apportionment must be exactly 9 characters in length.  If the primary field name is EXAMPLE, then the related field names would be EXAMPLE01 and EXAMPLE02, etc.
  • When specifying the length of the data apportionment (default length is 256 characters), the "–Lnnn" text specification must start in the eleventh position, i.e. the field name must allow for 10 characters (9 character field name plus a blank). For example:
  • <TEXTAREA NAME="COMMNT    -L020" WRAP="PHYSICAL" ROWS=3 COLS=20>
  • The column width of the text area does not have to equal the length of the apportionment fields, however it does help to determine if the text area apportionment is working correctly. In this example, the text area could have been ROWS=6 COLS=10, or ROWS=2 COLS=30.
  • JavaScript can be very helpful in ensuring that the correct data enters your system.  Along with the line added to the text area in the above example you could also add onChange="ChkLngTBox(this,60);" after the last quote of the onkeyup.  This will also catch an overflow if the user pastes data to the field.

What I Should Know

  • How to add a text area to a LANSA Web page.
  • How to use data apportionment to solve the 256 character field limitation.
  • How to use data apportionment to enhance Web pages.