You are viewing an old version of this page. View the current version.
Compare with Current View Page History
« Previous Version 7 Next »
The data wall widget provides an alternative way of presenting a collection of entities than is provided by die map or table widgets.
The example below describes the functionality that is provided by this widget. In addition, the widget can be hidden using visibility bindings.
<wall title="wall_title.tickets" defaultSort="receivedTime" commentHandler="handleComment"> <collectionSource function="getUnresolvedTickets"/> <itemTitle value="getTicketTitle"/> <itemText value="getTicketText"/> <itemTime value="getTicketTime"/> <itemIcon value="getTicketIcon"/> <itemAction label="wall_action.resolve" action="resolveTicket" /> <itemAction label="wall_action.delete" action="deleteTicket" /> </wall>
void handleComment(string comment) { logComment(comment); } string getTicketTitle(SupportTicket ticket) { return ticket.senderNumber; } string getTicketText(SupportTicket ticket) { return ticket.text; } datetime getTicketTime(SupportTicket ticket) { return ticket.receivedTime; } string getTicketIcon(SupportTicket ticket) { return "Person"; } SupportTicket[] getUnresolvedTickets() { return SupportTicket:and( equals(spam, false), equals(resolved, false) ); } void resolveTicket(SupportTicket ticket) { ticket.resolved = true; ticket.save(); } void deleteTicket(SupportTicket ticket) { ticket.spam = true; ticket.save(); }
In addition to the example above, item GPS coordinates can also be represented in the data wall widget. This is achieved in the same way as many other elements of the data wall:
<itemLatitude value="getTicketLat"/> <itemLongitude value="getTicketLong"/>
getTicketLat(SupportTicket ticket) { return ticket.lat; } getTicketLong(SupportTicket ticket) { return ticket.long; }
This provides an additional icon being displayed as well as an action that is triggered by clicking the icon. The screenshots below demonstrates this:
Add Comment
Add Comment