| ERW: The Manual | ||
|---|---|---|
| <<< Previous | Useful Functions | Next >>> |
To use these function, you must know some convention about the HTML elements identifiers generated by ERW. This is necessary, as to create useful hooks you need to be able to detect which row of a table the user selected.
Each relevant HTML element in a page generated by ERW has a well-defined identifier. In particular, whenever a list of elements is displayed to the user, the corresponding table has an identifier (in the XML sense) generated by prefixing a letter followed by the underscore character to a table name. More precisely:
main lists are named m_type;
in the editing of relationships, the list that lets the user choose entities is named s_relationship-type, whereas the list showing relationships is named r_relationship-type;
lists that lets the user edit a fileset are named f_entity-type_attribute-name.
Said that, you can use the following functions to discover which element of a list has been selected by the user:
Given the identifier of a list, this function returns the SQL identifier (i.e., the value of the id column) of the selected element.
Given the identifier of a list, this function returns the 0-based index of the selected row.
This function opens a new window without toolbar, menus, etc. and loads it with the given URL. The given name will be juxtaposed to the current number of milliseconds to generate a name for the window, so that two activations of the same button actually open two different windows.
You should look at the example given in the Section called The Button Hook in the Chapter called Customisation.
| <<< Previous | Home | Next >>> |
| Useful Functions | Up | Localisation |