| Advanced Features > Using DHTML-Based JSF Components to Build Web Applications > JavaScript Objects |
JavaScript Objects |
INDEX
PREVIOUS
NEXT
|
Each time a JViews Framework 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:
<jvf:view id="view" [...] /> |
will be rendered as the following JavaScript code:
var view = new IlvFacesViewProxy ('view', ...); |
| Note |
| 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 Framework.
For example, the following code defines a button that dynamically installs a zoom interactor on the view without a server round trip.
<jvf:panInteractor id="pan" <jvf:imageButton [...] onclick="view.setInteractor(pan)" /> <jvf:view id="view" [...] /> |
At rendering time, an IlvFacesViewProxy JavaScript object is created, that is accessible through the JavaScript variable. Then, since a pan JavaScript object 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 DHTML reference documentation of JViews Framework.
| Copyright © 1987-2007 ILOG S.A. All rights reserved. Documentation homepage. Legal terms. | PREVIOUS NEXT |