| Building Web Applications > Using DHTML-Based JSF Components to Build Web Applications > JavaScript Objects |
JavaScript Objects |
INDEX
PREVIOUS
NEXT
|
Each time a JViews Maps Faces component is created, a corresponding JavaScript object is also created. You can access this object through a global JavaScript variable whose name is the same as the id attribute of the tag. For example, the tag:
<jvmf:mapView id="map" [...] />
will be rendered as the following JavaScript code:
var map = new IlvDiagrammerViewProxy ('map', ...);
map.setServletClass("ilog.views.maps.servlet.IlvFacesMapsServlet");
See the documentation of the Java API of each renderer to know which JavaScript proxy will be generated for this component.
You can modify the object locally by using a set of methods attached to this object. For further information about available JavaScript objects, see the DHTML reference documentation of JViews Maps.
For example, Code Sample 2.6 defines a button that dynamically installs a zoom interactor on the view without a server round trip.
<jvf:panInteractor id="pan" <jvf:imageButton [...] onclick="map.setInteractor(pan)" /> <jvmf:mapView id="map" [...] /> |
At rendering time, an IlvDiagrammerViewProxy JavaScript object is created, accessible through the JavaScript variable.
Then, since a JavaScript object named pan has been created in the same way, you can directly set this interactor with the setInteractor method.
Additionally, the behavior of these JavaScript objects is to keep their state, so that if a submit request is issued, the state of the object is sent to the server. This behavior makes sure that the client and the server remain coherent.
For further information about available JavaScript objects, see the JavaScript API DHTML reference documentation of JViews Maps.
| Copyright © 1987-2007 ILOG S.A. All rights reserved. Documentation homepage. Legal terms. | PREVIOUS NEXT |