Associations and Client-Side Java Components
Client-side Java components, like server-side dynamic elements, use associations to synchronize state with the parent component. However, the association class they use is not the same. Instead of using next.wo.Association (the WOAssociation equivalent in Java), they use next.wo.client.Association, and this Association class is downloaded to the client along with the component itself.Keys for a client-side component fall into two groups: state bindings and action bindings. State bindings form the basis for state synchronization by associating state in the applets with state in the server. Action bindings associate particular events in the client applet (such as clicking a button) with the invocation of methods in the server.
State is synchronized between the client and the server in three phases:
- When a page is first generated, the server sends the client all state for which there are bindings.
- Before an action is invoked in the server, the client sends the server any of its state that has changed.
- After the action is completed, the server sends the client any of its state that has changed.
Note: The last two phases of the synchronization cycle can be initiated only on the browser side. That is, except for the first "initialization" phase, the server component can react only to an action triggered in an applet. The component cannot unilaterally update the state of an applet when its own state changes.
Table of Contents Next Section