Javascript Notes

Use of Javascript

Javascript is currently used to:

  1. In most display and data entry blocks: Open/close tables (the toggles)
  2. Drawing new/update: Manage the drawing code entry (syncronize the drawing horizontal vs. vertical code fields)
  3. Revision new/update: Manage the revision code entry (syncronize the drawing horizontal vs. vertical code fields)
  4. On change in the document (and comment) input forms
  5. Set focus (set for certain inputs form, mainly in the login form)
  6. To manage the hiding/display of cascading selects in V12.x. See: MultiClassification

  7. In revision new/update: to manage entry of approval/release comments (See below: Managing Approval/Release Comment Fields)

  8. Informing the server if the client has Javascript enabled

Issues

Managing Approval/Release Comment Fields

This applies to approval and release work flow steps for revisions. It is implemented for the new/update input forms.

Javascript Functionality

Other Supporting Functionality

Field Naming

The following fields are defined in the Revisions table:

The fields are also present in the Comments table, but the workflow templates that would display these fields have not yet been implemented.

Javascript Implementation

  1. app/tran/draw/rnew/RevisionNewFormBT calls RevisionForm:

    • $form->displayJavascriptInclude() -- Emits an include statements to read doStatusChange.js

    • $form->displayJavasScriptOnload() -- Emits a Javascript window.onload call and an initialization function, which calls doStatusChange for each status field.

  2. app/form/RevisionForm.php performs the following processing:

    • For each statusId field, it generates on onchange tag which calls the Javascript function doStatusChange.

  3. doStatusChange is defined in the file app/js/doStatusChange.js. It does the following:

    • show/hide the comment field based on the statusId
    • show/hide the planDate, completeDate and initials fields based on the statusId
    • clears fields which are hidden

The onload function calls doStatusChange for each statusId field.

JavascriptNotes (last edited 2010-01-26 20:30:02 by softxs)

Copyright 2008-2014, SoftXS GmbH, Switzerland