Try Xenarius Free

India Properties demo

The India Properties demo illustrates how to use third-party REST web services and pass parameters for server-side processing. This demo uses the nestoria.in data service for searching and displaying property listings. This article describes the main aspects of creating this app, such as binding to a data service, designing the views and providing navigation.

This demo consists of the following four views:

  • Search for properties – enables searching and filtering;

  • Favorites – lists the properties marked as favorites by a user;

  • Search Results – lists the search results;

  • About – displays information about the demo.

Retrieving Data

In this demo, the LocationStore data provider retrieves data from the Nestoria API. The Get Request Parameter function defines request parameters needed to perform the API calls. This function is defined in the Load section of the data provider configuration page. The Process Result function retrieves the actual property listing from the response object returned by the API.

The Get Request Parameter function receives request parameters from the Search For Properties view. These parameters are stored in the $model.storeOptions field of the Search For Properties view. The Search button passes this object to the Search Result view where these parameters are used for the Data SourceFilter property of the list. The filter appears as the $options variable in the Get Request Parameter function.

Favorites

Favorite listings are stored in the persistent $global.listings property. Xenarius automatically saves this property value when a user quits the program and loads it from the internal storage the next time a user opens the app again. The Favorites view has a list bound to the $global.listings property and displays every property in this list.

Both the lists on the Favorites and Search Results views use custom row templates for displaying the list of records.