This topic is locked

fireEvent() is outdated in vanilla JavaScript, is it outdated in PHPRunner, too?

10/26/2026 15:16:48
PHPRunner General questions
G
GJB author

fireEvent() is outdated in vanilla JavaScript, and should be replaced with dispatchEvent().
See: https://stackoverflow.com/questions/26335963/javascript-fireevent-not-a-function

Questions:

  • Is fireEvent() still current in PHPRunner?
  • Is it likely to be deprecated and replaced?


I have an Edit page with the following (which works, unless there's a better way to do it):

1 On the Designer tab, Edit page, set the initial "id_total_num_vertices" tag value to 0:

  • DB field: geom_json
  • HTML text: Total # of vertices: <span id='id_total_num_vertices'>0</span>

2 A Change field event, called display_npts, set on the geom_json (GeoJSON geometry) field, to set the "id_total_num_vertices" tag value.

display_npts field event --> Client Before:

var content = ctrl.getValue();
if (content != "") {
var inputcoords = JSON.parse (content);
// numberOfVertices is my own function to count the number of vertices in the geometry.
var retval = numberOfVertices (inputcoords);
// Change displayed values
$("#id_total_num_vertices").html(retval.total_num_vertices);
}
return false;

3 In the Edit page JavaScript OnLoad event, if the geom_json has an existing value when the Edit page is initially opened, set the "id_total_num_vertices" tag value by calling the Change event, display_npts:

var geom_json_ctrl = Runner.getControl(pageid, 'geom_json');
if (geom_json_ctrl) {
// If geom_json values already exist, display them.
if (geom_json_ctrl.getValue() != "") {
geom_json_ctrl.fireEvent('change'); // Trigger event: display_npts
}
}

PHPRunner 11.3, build 44417