PlaceDetailsClass

This class provides the UI for the place detail component containing rich content of a place e.g. reviews, guides, nearby places and owner content.

Example

 var detailComponent = new nokia.mh5.components.PlaceDetails({
     parameters: {
         appId: "demo_wwzrmoloHAFVvyW",
         appCode: "Vgl_08RQWnjJo92Lw1F_uQ"
     },
     place: {
         id: "276u33d8-e2482cc709e64ec68b55e3c233405f0a"
     },
     customContent: [{
         name: "myContent",
         before: "summary"
     }, {
         name: "myAnotherContent",
         after: "summary",
         innerHTML: "My static content"
     }],
     actions: {
         share: null,
         route: null
     },
     listeners: {
         update: function(e) {
             this.myContent.innerHTML = e.data.content;
        }
     }
 });
 document.body.appendChild(detailComponent.root);      

Inheritance hierarchy

nokia.mh5.Class
  nokia.mh5.ui.Control
    nokia.mh5.ui.Container
        nokia.mh5.components.PlaceDetails

Constructor Detail

Constructor of place details component.

new nokia.mh5.components.PlaceDetails(props, parentContainer);

Constructor Parameters

Type Name Description
Object props properties of the component. The only two properties of this component that cannot be overwritten are summary and recommendations.
nokia.mh5.ui.Container parentContainer parent container of the search component
Object | Array [props.customContent] one or more user defined components to add to place details
String props.customContent.innerHTML HTML markup for custom content
String props.customContent.before name of place details' child to insert custom content before
String props.customContent.after name of place details' child to instert custom content after
String props.customContent.name name of custom content, "customContent" by default
Object [props.actions] action buttons component, pass null to disable
Object [props.actions.dial] phone call button, pass null to disable
Object [props.actions.share] share button, pass null to disable
Object [props.actions.route] route button, pass null to disable
Object [props.actions.website] website button, pass null to disable
Object [props.actions.addFavourite] favourites button, pass null to disable
Object [props.ownerContent] place's description provided by the owner, pass null to disable
Object [props.guides] information provided by travel guides, pass null to disable
Object [props.reviews] reviews of the place, pass null to disable
Object [props.error] error screen, pass null to disable
Object [props.legalNote] legal notes is mandatory
Object [props.images] image gallery, pass null to disable
Object [props.listeners] listeners for predefined events
Object [props.listeners.nearby] this listener is called when an item from the recommendation list selected. The default behaviour is to show the details of the selected item. You can prevent it by calling preventDefault function on the received event.
Object [props.listeners.update] this listener is called when the content of the detail component has to be updated. As parameter you get an object with the property "data" containing the current details.

Methods    Hide Inherited

public visibleDidChange(visible) Missing Description
public build()
publicinherited add(control, name) Adds a control with the specified name to the container and adds the "parent" property set to the container to it.
publicinherited insertBefore(control, name, referenceControlName) Inserts a control with a specified name to the container before the control with the specified name and adds the "parent" property set to the container to it.
publicinherited getContentRoot() Returns the real DOM node of the control without scroll wrapper (if present).
publicinherited getRootOwnerByClass(Class) Retrieves the instance that owns the root node of the specified Class. Used to retrieve creator of the component inside bound events.
publicinherited prepareBindings() Calls prepareBindings on children controls (if available) and itself.
publicinherited prepareDidChangeNotifications() Calls prepareDidChangeNotifications on children controls (if available) and itself.
public remove(name)
public resize(dontUpdateCategory) Missing Description
public unitSystemDidChange(value) unitSystem binding
public update() Updates the page. If no place data set, the page will be just cleaned.

Properties    Hide Inherited

public Object spinner Missing Description
public Object control base nokia.mh5.ui container
public nokia.mh5.adapters.Search adapter if no search adapter is specified in the construction of the application, the default one is used. For details on how to create your own search adapter, please see the Getting Started Guide under "Customising Components > Search"
public nokia.mh5.ui.Container actions the button bar
public Array children Array with strings, which call the children of the container
public Object ad Placeholder for advertisement
public String cssClass
publicinherited Boolean dontBind makes sure, that the bindings in the container are initialized after the build function of all children is called.
public nokia.mh5.ui.Control ownerContent the section containing content provided by the owner of the place
public Object layout nokia.mh5.ui.RowLayout
public nokia.mh5.ui.Container legalNote UI element containing copyright statements for Nokia and image credit attributions mandatory ie - not settable, not removable
public Object images an instance of nokia.mh5.ui.Carousel along with configuration properties
public nokia.mh5.ui.Control guides the section containing content provided by travel guides
public Object parameters Parameters are passed to nokia.mh5.components.PlaceDetails.adapter.fetch function. The properties can be either primitives or functions. In the last case the functions will be called in the context of the place component.
public Object place holding object for the "place" being shown. Initially null.
public nokia.mh5.ui.Container recommendations the ui element relating to the places nearby populated by data from the Nokia recommendations. mandatory ie - not settable, not removable
public nokia.mh5.ui.Control reviews the section containing reviews of the place
public nokia.mh5.components.PlaceSummary summary summary of the place

Events

nokia.mh5.components.PlaceDetails has no events.

Callbacks

nokia.mh5.components.PlaceDetails has no callbacks.

Classes

nokia.mh5.components.PlaceDetails has no classes.

Constants

nokia.mh5.components.PlaceDetails has no constants.

Interfaces

nokia.mh5.components.PlaceDetails has no interfaces.