How to Add a Faces Configuration File How to Add a MyFaces Trinidad Skins Configuration File

Creating Custom ADF Faces Components 30-17 AcmeTagPane, { componentType:oracle.adfdemo.acme.TagPane,superclass:AdfUIObject } ;

30.3.2 How to Create a Javascript File for an Event

Use JDeveloper to create a JavaScript file for the event. Add code to the JavaScript to perform the functions required when a event is fired, such as a mouse click. To create the JavaScript for the event: 1. In the Application Navigator, right-click the project and select New. 2. In the New Gallery, expand Web Tier and select HTML. 3. Select JavaScript File and click OK. 4. In the Create JavaScript File dialog, do the following: ■ File Name : Enter the name of the client-side event. For example, for the tagPane component, you might enter AcmeTagSelectEvent.js. ■ Directory : Enter the directory path of the event in a subdirectory under the src directory. For example, for the tagPane component, you might enter adf-richclient-demo-acme\src\oracle\adfdemo\acme\js\event.

5. Open the JavaScript File in the editor and add the event code.

Example 30–6 shows the event code that might be added for the tagPane component. Example 30–6 tagPane Event JavaScript Fires a select type event to the server for the source component when a tag is clicked. function AcmeTagSelectEventsource, tag { AdfAssert.assertPrototypesource, AdfUIComponent; AdfAssert.assertStringtag; this.Initsource, tag; } make AcmeTagSelectEvent a subclass of AdfComponentEvent AdfObject.createSubclassAcmeTagSelectEvent, AdfComponentEvent; The event type AcmeTagSelectEvent.SELECT_EVENT_TYPE = tagSelect; Event Object constructor AcmeTagSelectEvent.prototype.Init = functionsource, tag { AdfAssert.assertPrototypesource, AdfUIComponent; AdfAssert.assertStringtag; Tip: To prevent naming collisions, start the name with the component prefix. 30-18 Web User Interface Developers Guide for Oracle Application Development Framework this._tag = tag; AcmeTagSelectEvent.superclass.Init.callthis, source, AcmeTagSelectEvent.SELECT_ EVENT_TYPE;} Indicates this event should be sent to the server AcmeTagSelectEvent.prototype.propagatesToServer = function { return true; } Override of AddMarshalledProperties to add parameters sent server side. AcmeTagSelectEvent.prototype.AddMarshalledProperties = function properties { properties.tag = this._tag; } Convenient method for queue a AcmeTagSelectEvent. AcmeTagSelectEvent.queue = functioncomponent, tag { AdfAssert.assertPrototypecomponent, AdfUIComponent; AdfAssert.assertStringtag; AdfLogger.LOGGER.logMessageAdfLogger.FINEST, AcmeTagSelectEvent.queuecomponent, tag; new AcmeTagSelectEventcomponent, tag.queuetrue; } returns the selected file type AcmeTagSelectEvent.prototype.getTag = function { return this._tag;} returns a debug string AcmeTagSelectEvent.prototype.toDebugString = function { var superString = AcmeTagSelectEvent.superclass.toDebugString.callthis; return superString.substring0, superString.length - 1 + , tag= + this._tag + ]; } Make sure that this event only invokes immediate validators on the client. AcmeTagSelectEvent.prototype.isImmediate = function { return true; }