Panther Web Application Broker Enhancements

Panther 5.60 introduces several new features for the Web Application Broker (jserver) that improve HTML generation and client-side customization. These enhancements provide greater control over styling and behavior of Panther-generated web applications.

1. Enhanced Styling with PR_SPAN_CLASSES and PR_WEB_NO_DISP_ATTRS

Both properties default to PV_NO.

PR_SPAN_CLASSES

When set to PV_YES, Panther generates <span> tags before widget text for widgets that do not otherwise emit a tag containing that text. These spans include a class attribute based on widget type:

If a widget has a custom class defined via its PR_ATTRIBUTES property, the generated <span> tag will include both classes, enabling more granular styling.

Note: This behavior is similar to using PR_WEB_GENERATE_IDS with PV_WEB_IDS_SPAN, but PR_SPAN_CLASSES does not add an id attribute unless PR_WEB_GENERATE_IDS is also configured accordingly.

PR_WEB_NO_DISP_ATTRS

When set to PV_YES, Panther no longer generates <div class="sm_fontstyle" style="..."> tags for widgets with font properties (bold, italic, underline, point size). This allows developers to fully control font styling via CSS classes without Panther injecting inline styles.

Note: When generated, the <div> is now a <span> due to Bug Fix 39186.


2. Customizing JavaScript Alerts with PR_WEB_JS_ALERT

This feature addresses the limitation of customizing pop-up messages used in Panther-generated JavaScript for client-side validations. Previously, Panther used the standard alert() function. Now, all generated JavaScript calls a wrapper function named alertWrapper:

function alertWrapper(t, msgid, msg)
{
    alertMsg(t, msgid, msg);
}

function alertMsg(t, msgid, msg)
{
    alert(msg);
}

To override this behavior, Panther introduces a new application property:

Your custom function must accept three arguments:

  1. this . the widget or context
  2. msgid . the message file identifier
  3. msg . the formatted message string

Example JPL assignment:

@app()->web_js_alert = "myAlertFunc"

This results in the following JavaScript being generated:

function alertWrapper(t, msgid, msg)
{
    myAlertFunc(t, msgid, msg);
}

In this case, you must implement myAlertFunc yourself. You can include it via a <script> tag referencing an external JavaScript file:

<script src="path/to/myAlertFunc.js"></script>

Note: When PR_WEB_JS_ALERT is assigned a non-empty string, the default alertMsg() function is not generated in the output.