How to Set Up the JDeveloper Custom Component Environment

Creating Custom ADF Faces Components 30-15 http:java.sun.comdtdfacelet-taglib_1_0.dtd facelet-taglib xmlns=http:java.sun.comJSFFacelet namespacehttp:xmlns.oracle.adfdemoacmenamespace tag tag-nametagPanetag-name handler-class oracle.adfinternal.view.faces.facelets.rich.RichComponentHandler handler-class tag facelet-taglib 6. Replace the namespace and tag-name code shown in bold with code appropriate for your application.

30.3 Client-Side Development

After the JDeveloper workspace and configuration files have been created, you can create and code the client-side JavaScript files. When you have finished with the client-side development, create the server-side files, as described in Section 30.4, Server-Side Development. Client components hold state for properties that are not defined within the corresponding DOM element. These properties are bound to an associated DOM element using the clientId. The clientId uniquely defines a server-side component within the component tree representing a page. The DOM element holds the clientId within the Id attribute. Developing the client-side component requires creating a JavaScript file for the component, the peer, and the component event. In addition to the client component, client-side events must be defined. The tagPane component’s client-side event is fired and propagated to the server when the user clicks one of the three file types. The client event passed to the server is queued so that the target server-side component can take the appropriate action. Finally, the custom component requires a client peer. The peer is the component presenter. Peers act as the links between a client component and an associated DOM element. Client peers add client behaviors. A peer must be bound to a component through a registration method. As with the client component, the associated peer is bound to a DOM element using the components clientId. There are two types of peers, statefull and stateless. Best Practice: Because JavaScript libraries do not have namespaces, you should create all JavaScript object names for the custom component using the same prefix. You do not need to do this on the server because the server-side Java package names will prevent name collisions. For example, for the tagPane component, the client-side JavaScript object names all have the acme prefix. Note: Place each JavaScript object in its own separate source file for best practice and consistency.