Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 10. Building Custom Forms > Using Entity Templates to Control Field Tem...

Using Entity Templates to Control Field Templates

Although this latest implementation of the Region_Edit field template does what it needs to do for the Customers entity template, it has a significant design flaw that limits its reuse. By locating the Country field template directly, it assumes that the name of the field storing the country name is always Country. Although this is correct for the Customer, Employee, and Supplier entities in the Northwind data model, this is not the case for the Order entity where the column storing the country name is called ShipCountry. Obviously, this would prevent you from being able to use the Region field template to build an order entry screen. This assumption also creates another problem–the Region field template requires you to have the Country field on the page. This would prevent you from using this control if you wanted to build a Customer form specific for the U.S. customers only. You can overcome these limitations by moving the logic that determines the country out of the Region field template and placing it in the Customer entity template that hosts it.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial