Wednesday, May 31, 2006

Creating the Lookup Screens

One of the early challenges in designing this application was how to create the lookup screens for the terms, sales reps, shippers, customers, accounts, vendors, etc. that would be used throughout the app in all the document entry areas. We needed a reusuable screen that could be popped up, would pull its own data, allow selection from the grid, and ending with the data selected being distributed back to the calling area.

The use of the TitleWindow with the PopUpManager made this very straightforward. All the lookups were built in the same way with only changes to the webservice query call and the datagrid columns. Otherwise, all follow the same model.

Example: In the customer invoice, you will find the following lookups at the middle of the invoice screen.




By clicking on the lookup icon ( looks like a grid ) for Terms, the following screen will appear.



The screen is modal so you must choose either the Ok or Cancel button to close the screen. The Ok button is enabled only when a selection has occurred in the grid.

If you would like to look at the code for this lookup, you may download from:

http://www.is2software.com/quickbooks/is2qb/Terms_lu.mxml

Also, I have loaded a pdf tutorial where I have tried to describe how the lookups work. Maybe this will help someone who is starting out with Flex.

http://www.is2software.com/quickbooks/is2qb/Build_Terms_Lookup.pdf

If there is a better way, please feel free to tell me. I am by no means a Flex expert. I am still learning how to putter around in Flex Builder 2.