Gen Web Generation HTML Text custom JavaScript not working under Web View
search cancel

Gen Web Generation HTML Text custom JavaScript not working under Web View

book

Article ID: 203829

calendar_today

Updated On:

Products

Gen Gen - Workstation Toolset

Issue/Introduction

Existing Gen Web Generation (JVM, INTERNET) has a working HTML Text custom JavaScript. After generating the same application for Web View from Gen Studio, the JavaScript no longer works as expected.

Environment

Component : ECLIPSE WEB VIEW

Resolution

  • Tested provided model using browser with Developer option (F12) enabled.
    The Console tab shows Warning message:

         "[Deprecation] Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user’s experience."

    However, that message turned out not to be significant.

  • The HTML Text for Web View must be XHTML-compliant:  HTML Control and HTML Text.

    Using the XHTML validation steps on the above link create an XHTML document (.html file) with body from the HTML Text field. Run that file through the W3C > Markup Validation Service to correct any errors.

  •  After ensuring XHTML compliance, the custom html still does not display in Web View application.

    The other key factor is that information from an HTML Text does not display on the UI because that control is not placed on the UI when it is created at design time. So instead, an HTML Control needs to be used for Web View because that control is placed on the UI at design time. The "no UI" limitation for HTML Text properties is also documented here:  HTML Text Properties Dialog. That is in comparison with HTML Control properties documented here:  HTML Control Properties Dialog.

    For Web Generation, it is confusing that both an HTML Control and HTML Text will display as expected on the UI. Web Generation is embedding the HTML text into the HTML page and is hence able to show it in the UI. However, it still requires some luck to see this every time based on the complexity of the UI and the order of placement. The HTML Text would sometimes be placed on the UI while other times may be overlapped with others and may not be easy to correct the position of the HTML Text because it does not have any positional information. Therefore, even though Web Generation displays the HTML Text information on the UI it is advised to always use an HTML Control for the UI otherwise unexpected behaviors may occur i.e. sometimes it will show up while sometimes it may get placed beyond the window or overlapped.

  •  In summary the Web View application needs to use XHTML compliant html inside an HTML Control instead of an HTML Text control.