What Happens at Runtime: How Client and Server Listeners Work Together

5-18 Web User Interface Developers Guide for Oracle Application Development Framework Encoding for a table also uses JSON to pass push messages to the client. The following is an example of an envelope containing a single encoded push message: [{rKey:0,type:update,data:[{val:Active Data Every Second: on row 0:78,prop:value,cInd:0},{val:Active Data Every Second: on row 0:78,prop:value,cInd:1}]}] The envelope is a JavaScript Array with only one object, which describes the message. This message contains information about the type of change, the actual value of the data, and so on, that is then used by the client-side table peer to update the table itself. Table 5–6 shows the mapping between corresponding Java and JavaScript types. Note that there could be some loss of information during the conversion process. For example, say you are using the following custom event to send the number 1 and the String test, as shown in the following example: AdfCustomEvent.queueevent.getSource, something, {first:1, second:test}; In the server-side listener, the type of the first parameter would become a java.lang.Double because numbers are converted to Doubles when going from JavaScript to Java. However, it might be that the parameter started on the server side as an int, and was converted to a number when conversion from Java to JavaScript took place. Now on its return trip to the server, it will be converted to a Double.

5.5 Executing a Script Within an Event Response

Using the ExtendedRenderKitService class, you can add JavaScript to an event response, for example, after invoking an action method binding. It can be a simple message like sending an alert informing the user that the database connection could not be established, or a call to a function like hide on a popup window to programatically dismiss a popup dialog. For example, in the File Explorer application, when the user clicks the UpOneFolder navigation button to move up in the folder structure, the folder pane is repainted to Table 5–6 Java to JavaScript Type Map Java Type JavaScript Type java.lang.Boolean Boolean java.lang.Double Number java.lang.Integer Number java.lang.Float Number java.lang.Long Number java.lang.Short Number java.lang.Character String java.lang.CharSequence String java.util.Collection Array java.util.Date Date java.util.Map Object Array Array java.awt.Color TrColor