Letractively / morisoliver

Automatically exported from code.google.com/p/morisoliver
0 stars 0 forks source link

Add the ability to have dropdowns when editing that pull values from a database table for a subset of records #114

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
This is Enhancement 1 in Task Order 4

Overview:
This enhancement will allow a single attribute of an editable data-layer to be 
rendered as a select or type-ahead-find element when editing is performed on 
that layer.  The values available via the select or type-ahead-find element 
will be the results of performing a of a non-spatial attribute-matching query.  
This non-spatial attribute-matching query will compare a single, configured 
value (e.g. a “site id”) with a “lookup table” providing a list of 
unique values for that single configured value (e.g. “buildings by site 
id”).

An example:
Consider an OLIVER site with the layers Sites (polygon), and Buildings 
(polygon).  The Buildings layer is editable, and the “name” attribute of 
the Buildings layer is configured to be a “query-powered” attribute.  The 
Buildings.name attribute is configured to present a select-box of all distinct 
Building_names.bldg_name values from the Building_names table where 
Building_names.site_id is equal to the currently selected site_id.

The user indicates (either indirectly via a permalink, or directly through 
making a UI selection) that they wish to work with site id SITE-A1.

When the user then
 activates the “editor” tool
 selects the building layer for editing
 selects a single building feature and the “edit attributes” box is 
displayed
then the following behavior will be available:

1.  The building-name attribute in the “edit attributes” box will be 
rendered with a select-box
2.  The options in the select box will be the results of running a query 
substantially similar to:

SELECT distinct(building_names.bldg_name) FROM building_names where 
building_names.site_id = 'SITE-A1'

Configuration options:
When setting up a site for such editing, the following pieces of configuration 
information will need to be supplied:
1.  The “match value” (e.g. “SITE-A1”)
2.  The “lookup table” name (e.g. building_names)
3.  The “lookup table match column” (e.g. building_names.site_id)
4.  The “lookup table match value” (e.g. building_names.bldg_name)
5.  (optionally) the “lookup table match label” (e.g. 
building_names.bldg_extended_description)

If provided, the lookup table match value will be used in the <option 
value=”value”> part of a select box, while the lookup table match label 
will be used as the label part of the select box.  The lookup table match label 
is not used in the type-ahead-find version of this tool.

Implementation of the configuration of item #1 will allow for definition of the 
match value in Javascript.  This will allow a “permalink” to be generated 
which pre-selects a given site id, for a given configured site.

Original issue reported on code.google.com by Aleda.Fr...@state.ma.us on 23 Jan 2012 at 2:14

GoogleCodeExporter commented 8 years ago
For the spatial filter option we'd like to have the dropdown not to show any 
sites if the user zooms to a non-site area (out of any site polygons).  

Original comment by Aleda.Fr...@state.ma.us on 12 Mar 2012 at 3:03

GoogleCodeExporter commented 8 years ago
Comment 1 resolved as per 
http://code.google.com/p/morisoliver/source/detail?r=336

Given an edit field, restricted by a quick zoom, if the quick zoom has no 
value, a null value, or a value of "", the edit field will not have any 
available options.  

Original comment by maric423@gmail.com on 12 Mar 2012 at 4:16

GoogleCodeExporter commented 8 years ago

Original comment by Aleda.Fr...@state.ma.us on 22 Mar 2012 at 6:28