Roster and Entities Example

An example demonstrating how to use CAXL's entity and roster classes to fetch and display contacts.

How it Works

This example automatically performs a number of actions in the page onReady event:
  1. Creating a jabberwerx.Client.
  2. Creating a jabberwerx.RosterController for automatic roster retrieval.
  3. Registering for jabberwerx.EntitySet Cache Events to handle roster updates.
The example also demonstrates (based on user actions like button clicks) additional roster functionality available within CAXL:

In Action

The simple roster shown in this example shows the user the roster item's type, JID, display name, groups the item belongs to and type specific properties. If the item (entity) is a contact an additional remove action is shown.

Instructions for using this example:

  • Click the "Connect" button to connect the client to the server.
  • Observe the roster being populated after connection.
  • Select "Show Contacts Only" to see filtering in action.
  • Click the "Add a Contact" button to be prompted for a username to subscribe to.
  • When possible, click the "X" in the far right field of the roster to remove, or unsubscribe, from a contact.
 
 
Entity Type JID Display Name Groups Properties Actions
Show Contacts Only