Difference between revisions of "JavaScript functions v1.0"

From TempusServa wiki
Jump to navigation Jump to search
old>Admin
old>Admin
Line 21: Line 21:
=== Toggling fields (version 5478+) ===
=== Toggling fields (version 5478+) ===
Fields can be  shown or hidden calling the fieldname
Fields can be  shown or hidden calling the fieldname
* hideField(fieldName)
* '''hideField(fieldName)'''
* showField(fieldName)
* '''showField(fieldName)'''


Examples
Examples
Line 31: Line 31:


Hiding and showing fields can be made dependent on classes in the TempusServaPage and/or items current status.
Hiding and showing fields can be made dependent on classes in the TempusServaPage and/or items current status.
* hideFieldForPageClass(fieldName)
* '''hideFieldForPageClass(fieldName)'''
* showFieldForPageClass(fieldName)
* '''showFieldForPageClass(fieldName)'''
* hideFieldForStatusId(fieldName)
* '''hideFieldForStatusId(fieldName)'''
* showFieldForStatusId(fieldName)
* '''showFieldForStatusId(fieldName)'''
* hideFieldForPageClassAndStatusId(fieldName,className,statusId)
* '''hideFieldForPageClassAndStatusId(fieldName,className,statusId)'''
*showFieldForPageClassAndStatusId(fieldName,className,statusId)
*'''showFieldForPageClassAndStatusId(fieldName,className,statusId)'''


Note: This is NOT intended for denying access to data -it will only be hidden in the frontend, but is still accessible to savvy users.
Note: This is NOT intended for denying access to data -it will only be hidden in the frontend, but is still accessible to savvy users.

Revision as of 16:20, 6 January 2021

Builtin functions

Handling form values

Display values are handled using standard getter and setters

  • getValue(fieldName)
  • setValue(fieldName,value)

Example

  var a = getValue("NUMBER1");
  var b = getValue("NUMBER2");
  setValue( "RESULT", (a-b) );

For explicitly getting a value (or ID) use

  • getDecimal(fieldName)

Example

 var recordId = getDecimal("SELECTRECORD");

Toggling fields (version 5478+)

Fields can be shown or hidden calling the fieldname

  • hideField(fieldName)
  • showField(fieldName)

Examples

  hideField("USER")
  hideField("StatusID")

Hiding and showing fields can be made dependent on classes in the TempusServaPage and/or items current status.

  • hideFieldForPageClass(fieldName)
  • showFieldForPageClass(fieldName)
  • hideFieldForStatusId(fieldName)
  • showFieldForStatusId(fieldName)
  • hideFieldForPageClassAndStatusId(fieldName,className,statusId)
  • showFieldForPageClassAndStatusId(fieldName,className,statusId)

Note: This is NOT intended for denying access to data -it will only be hidden in the frontend, but is still accessible to savvy users.

Other sources