Deprecation Warning! The content below is only applicable for use within deprecated 1.x versions of CA Agile Central's App SDK. Use of the component(s) and/or code on this page is not supported. To develop custom apps within our current environments, please see App SDK 2.1 documentation.

The Chooser component displays a dialog with a list of artifacts from which to choose.

The list can be filtered based on text found in the Name, Description, or Notes of the artifact through an input field. You can configure the chooser to display any type of artifact (like user stories, defects, or projects).


Chooser includes the following topics:

Create a Chooser

First include the App SDK javascript:

<script type="text/javascript" src="/apps/[version]/sdk.js"></script>

Instantiate a new chooser:

var chooser = new rally.sdk.ui.Chooser(config, rallyDataSource);

The parameters for rally.sdk.ui.Chooser are as follows:

Parameter Description Example
config* A chooser configuration object
{ type: "defect", title: "Choose a Defect" }
rallyDataSource* An instance of

* = required parameter

The Chooser configuration object supports the following properties:

Parameter Description Example
type* A Rally artifact type
title* The title of the dialog
"Choose a User Story"
fetch A comma-delimited list of additional properties on the artifacts to fetch; by default, will fetch Name and FormattedID (if available)
draggable Allow the dialog to be draggable
closeable Show the x icon to close the dialog
query A filter clause to be applied to the object query, may be a string or a Query object
'ScheduleState = "In-Progress"'
width The width of the dialog (defaults to 400)
height The height of the chooser (defaults to 300)

* = required parameter

Display a Chooser

After you create the chooser, use the display method to show the chooser:

Parameter Description Examples
onCloseCallback An optional function that will be called when a user selects an item and clicks OK
function(chooser, eventArgs){

* = required parameter


The Chooser component defines the following methods:

Method Name Parameters Description Example
display callback Displays the chooser.

The callback function is called when a user chooses OK and is past the selected item. May also use addEventListener to attach callback.

chooser.display(function(chooser, args){
   var selectedItem =
destroy - Removes this component
getValidEvents - Returns a map of events this component supports

* = required parameter


Events are used to notify consumers of a component when actions occur.

The following methods are provided in order to interact with this component's events:

Method Parameters Description Example
addEventListener eventName*, listener*, scope

Registers the specified listener with the component's queue for the specified event and returns an object which can be used to remove the event listener later. The listener parameter should be a function with two parameters:

1) the component that fired the event;

2) an eventArgs object with properties specific to the event being fired. This function will be called by the component when the event occurs.

If the optional scope parameter was specified the function will be called on that object (like scope.listener(sender, args);).

function listener(sender, eventArgs) {
   //Respond to event
var eventObj =
removeEventListener eventObj*

Unregisters the specified event from the component.

The eventObj parameter should be the return value of addEventListener() when the listener was originally registered.

var eventObj =
getValidEvents - Returns an object with a property for each event name supported by the component. This is useful for passing as the first parameter to addEventListener().
var eventName = component.getValidEvents().onClick;

* = required parameter

The Chooser component supports the following events:

Event Name Description Event Arguments Example
onClose Fired when the chooser is closed. The eventArgs object contains a single property:

selectedItem: the item the user selected from the chooser.

function onCloseCallback(chooser, eventArgs) {
   var selectedItem = eventArgs.selectedItem;
onDataRetrieved Fired when the data query has returned, but before it has been rendered. Useful for modifying data before it is bound into the table of the chooser. The eventArgs object contains the following property:

items: The array of Rally objects returned from the data query.

function onChooserDataRetrieved(chooser, eventArgs){
   var items = eventArgs.items;
chooser.addEventListener("onDataRetrieved", onChooserDataRetrieved);
onLoad Fired when the chooser's data has been fully rendered. Called only once. No args passed to the function.
function onChooserLoad(chooser) {
   //chooser loaded


Copy and paste the following into a Rally custom app.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "">
<!-- Copyright (c) 2011 Rally Software Development Corp. All rights reserved -->
   <title>Component Example: Chooser</title>
   <meta name="Name" content="Component Example: Chooser" />
   <meta name="Version" content="2011.2" />
   <meta name="Vendor" content="Rally Software" />
   <script type="text/javascript" src="/apps/1.26/sdk.js"></script>
   <script type="text/javascript">

     function chooserOnClose(chooser, args) {
       var selectedItem = args.selectedItem;

     function onLoad() {

       var rallyDataSource = new'__WORKSPACE_OID__',

       var chooserConfig = {
         type : "HierarchicalRequirement",
         title : "Choose a User Story"

       var chooser = new rally.sdk.ui.Chooser(chooserConfig, rallyDataSource);





Benötigen Sie weitere Informationen? Die CA Agile Central-Community ist Ihre zentrale Anlaufstelle für Self-Service und Support. Treten Sie der CA Agile Central-Community bei, um dem CA Agile Central-Support Feedback mitzuteilen oder Fälle zu melden, Antworten zu finden oder mit anderen Benutzern zusammenzuarbeiten.