Presenting Multiple Views of the Same Data

Labels
AJAX(112) App Studio(7) Apple(1) Application Builder(245) Application Factory(207) ASP.NET(95) ASP.NET 3.5(45) ASP.NET Code Generator(72) ASP.NET Membership(28) Azure(18) Barcode(2) Barcodes(3) BLOB(18) Business Rules(1) Business Rules/Logic(140) BYOD(13) Caching(2) Calendar(5) Charts(29) Cloud(14) Cloud On Time(2) Cloud On Time for Windows 7(2) Code Generator(54) Collaboration(11) command line(1) Conflict Detection(1) Content Management System(12) COT Tools for Excel(26) CRUD(1) Custom Actions(1) Data Aquarium Framework(122) Data Sheet(9) Data Sources(22) Database Lookups(50) Deployment(22) Designer(177) Device(1) DotNetNuke(12) EASE(20) Email(6) Features(101) Firebird(1) Form Builder(14) Globalization and Localization(6) How To(1) Hypermedia(2) Inline Editing(1) Installation(5) JavaScript(20) Kiosk(1) Low Code(3) Mac(1) Many-To-Many(4) Maps(6) Master/Detail(36) Microservices(4) Mobile(63) Mode Builder(3) Model Builder(3) MySQL(10) Native Apps(5) News(18) OAuth(8) OAuth Scopes(1) OAuth2(11) Offline(20) Offline Apps(4) Offline Sync(5) Oracle(10) PKCE(2) PostgreSQL(2) PWA(2) QR codes(2) Rapid Application Development(5) Reading Pane(2) Release Notes(179) Reports(48) REST(29) RESTful(29) RESTful Workshop(15) RFID tags(1) SaaS(7) Security(80) SharePoint(12) SPA(6) SQL Anywhere(3) SQL Server(26) SSO(1) Stored Procedure(4) Teamwork(15) Tips and Tricks(87) Tools for Excel(2) Touch UI(93) Transactions(5) Tutorials(183) Universal Windows Platform(3) User Interface(338) Video Tutorial(37) Web 2.0(100) Web App Generator(101) Web Application Generator(607) Web Form Builder(40) Web.Config(9) Workflow(28)
Archive
Blog
Sunday, August 10, 2008PrintSubscribe
Presenting Multiple Views of the Same Data

Ability to see multiple views of the same data is an invaluable tool for the end users of your applications. It provides increased productive due the reduced time spent while searching for data.

Let's generate a Data Aquarium Framework application from the Northwind database and research the multiple view presentation capabilities of the framework. If you run the application and select Customers option from the drop down at top of the page then the following view of customers is displayed.

image

At the right side of the blue tool bar above the grid you can see the orange view selector that shows Customers in it. You can expand the list of views to provide alternative presentation of data without any coding.

Suppose you want to display phone and fax information on screen and don't really care if the customer ID is available. Open the ~/Controllers/Customers.xml data controller descriptor file in Visual Studio 2008 and add the following markup in the views section:

    <view id="grid2" type="Grid" commandId="command1" label="Phone/Fax">
      <headerText>List of customers with phone and fax. </headerText>
      <dataFields>
        <dataField fieldName="CompanyName" columns="40" />
        <dataField fieldName="Phone" columns="24" />
        <dataField fieldName="Fax" columns="24" />
        <dataField fieldName="Country" columns="15" />
        <dataField fieldName="ContactName" columns="30" />
        <dataField fieldName="ContactTitle" columns="30" />
      </dataFields>
    </view>

This is how the data will be presented if you refresh the page and select the name of the new view in the view selector. Notice that each view maintains its own sorting, adaptive filtering, and current page when you switch from one view to another.

image

You may also provide an alternative query to produce data displayed in the view. Imagine that you want to have a quick way to list all customers from United States of America. You will need to define the following command in commands section of the data controller:

    <command id="command2" type="Text">
      <text>
        <![CDATA[
select
    "Customers"."CustomerID" "CustomerID"
    ,"Customers"."CompanyName" "CompanyName"
    ,"Customers"."ContactName" "ContactName"
    ,"Customers"."ContactTitle" "ContactTitle"
    ,"Customers"."Address" "Address"
    ,"Customers"."City" "City"
    ,"Customers"."Region" "Region"
    ,"Customers"."PostalCode" "PostalCode"
    ,"Customers"."Country" "Country"
    ,"Customers"."Phone" "Phone"
    ,"Customers"."Fax" "Fax"
from "dbo"."Customers" "Customers"
where
  "Customers"."Country"='USA'
]]>
      </text>
    </command>

Also add the following view in the views section:

    <view id="grid3" type="Grid" commandId="command2" label="USA Customers">
      <headerText>List of customers from United States of America. </headerText>
      <dataFields>
        <dataField fieldName="CompanyName" columns="40" />
        <dataField fieldName="ContactName" columns="30" />
        <dataField fieldName="ContactTitle" columns="30" />
        <dataField fieldName="Address" />
        <dataField fieldName="City" columns="15" />
        <dataField fieldName="Region" columns="15" />
        <dataField fieldName="PostalCode" columns="10" />
        <dataField fieldName="Phone" columns="24" />
      </dataFields>
    </view>

View grid3 is referring to command2 in the commandId attribute of the view element.

The following presentation will be available to application users from now on. Independent sorting, paging, and current page are automatically maintained for this view as well.

image

Notice that all views are instantly available in any data lookups that are referring to Customers data controller. Verify that by navigating to the orders screen. Select any order and edit the record. Click on the Customer Company Name link and try selecting the views that we have defined.

image

Data Aquarium Framework provides unparalleled ease and flexibility in defining custom presentation views of your data.