PowerBuilder appears to hang when using older rich-text templates with input fields

Symptom

A DataWindow in a PowerBuilder application is using Rich Text Format (RTF) based on older templates having input fields.

Sometimes, for example while printing several rich-text documents, the application appears to hang or becomes unresponsive with CPU going to 100%.

Environment

  • PowerBuilder

  • RTF Control or DataWindow

Reproducing the Issue

  1. Migrate a PowerBuilder 9 application containing RTF DataWindows having input fields

  2. Run the application

  3. Repeatedly print the RTF DataWindows

Cause

The issue can occur when using older versions of input field formats with current rich-text technology.

The build-in rich text control uses \txfielddef format for input fields like in the following example:

        {\txfielddef

        {\*\txfieldstart\txfieldtype0\txfieldflags128\txfielddata
        7b00430046005f005300540052005f0050004c005a005f004f00520054007d000000}

        {\*\txfieldtext Contrescarpe 75, 28195
        Bremen{\*\txfieldend}}

        Contrescarpe 75, 28195 Bremen

        }

Older templates, giving problems, could possibly have been generated by much older versions of PowerBuilder like PowerBuilder 9.0 and the source might contain a different conflicting format for the input fields as in the following example:

{\field\fldlock

        {\*\fldinst {\{CF_STR_PLZ_ORT\}}}

        {\fldrslt{Contrescarpe 75, 28195 Bremen}}

        }

Solution

The rich-text code of the template needs to be corrected so that the format \txfielddef is used:

  1. Delete the old formats from the template

  2. Re-insert or newly generate the input fields with the current version of PowerBuilder