Opened 7 years ago

Closed 7 years ago

#156 closed Enhancement (Fixed)

Query Builder - display set of different single name/value dimensions as a selection group - survey yes/no answers

Reported by: Garth Braithwaite Owned by: Tong Zheng
Priority: +Medium Milestone: 2.1 - Testing
Component: View-App Version: 2.1
Severity: Unknown Keywords:
Cc:

Description

Need to be able to display a set of different single value dimensions as a single group of selections on the query builder page.

The issue is having to have a redundant, extra layer of a single selection single dimension when trying to filter a boolean type selection (yes/no survey response). See the attached screen shot.

These boolean type parameters can't be refactored into a dimension set because the data does not exist that way. Each yes/no survey answer is a distinct SAS variable or dataset column.

There's a few ways to solve this. The cleanest is to modify the XSLT code to use the dimension name and value directly as a leaf node selection when there's only 1 value element. Could be explicit and add another QM control element that specifies this just in case there are instances when a QM developer wants this behavior?

Attachments (1)

screenshot.png (59.8 KB) - added by Garth Braithwaite 7 years ago.
example of redundant survey selections

Download all attachments as: .zip

Change History (9)

Changed 7 years ago by Garth Braithwaite

Attachment: screenshot.png added

example of redundant survey selections

comment:1 Changed 7 years ago by Garth Braithwaite

Owner: set to Testing

fixed and tested in 3319 & 3320.

Example of old way module was coded: <SELECTIONS>

<NAME>BirthOccurProxy?</NAME> <TITLE>Select the type of residence you would like to include in your analysis. Click on the term to see a more detailed explanation. The default is resident births.</TITLE> <DESCRIPTION>Filter by resident or occurent birth</DESCRIPTION> <ibis:include href="../help/BirthOccur.xml"/> <SELECTION_TYPE><SINGLE/></SELECTION_TYPE>

<SELECTION>

<TITLE>All resident births</TITLE> <VALUE>BirthOccurRes?</VALUE> <SELECTIONS>

<DIMENSION_NAME>BirthOccurRes?</DIMENSION_NAME> <SELECTION_TYPE><MULTIPLE/></SELECTION_TYPE>

</SELECTIONS>

</SELECTION>

<SELECTION>

<TITLE>All occurrent births</TITLE> <VALUE>BirthOccurUt?</VALUE> <SELECTIONS>

<DIMENSION_NAME>BirthOccurUt?</DIMENSION_NAME> <SELECTION_TYPE><MULTIPLE/></SELECTION_TYPE>

</SELECTIONS>

</SELECTION>

<SELECTION>

<TITLE>All resident births in Utah</TITLE> <VALUE>BirthOccurResUt?</VALUE> <SELECTIONS>

<DIMENSION_NAME>BirthOccurResUt?</DIMENSION_NAME> <SELECTION_TYPE><MULTIPLE/></SELECTION_TYPE>

</SELECTIONS>

</SELECTION>

</SELECTIONS>

New way: <SELECTIONS>

<NAME>BirthOccurProxy?</NAME> <TITLE>Select the type of residence you would like to include in your analysis. Click on the term to see a more detailed explanation. The default is resident births.</TITLE> <DESCRIPTION>Filter by resident or occurent birth</DESCRIPTION> <ibis:include href="../help/BirthOccur.xml"/> <SELECTION_TYPE><SINGLE/></SELECTION_TYPE>

<SELECTION>

<SELECTIONS>

<DIMENSION_NAME>BirthOccurRes?</DIMENSION_NAME> <SELECTION_TYPE><HIDDEN/></SELECTION_TYPE>

</SELECTIONS>

</SELECTION>

<SELECTION>

<SELECTIONS>

<DIMENSION_NAME>BirthOccurUt?</DIMENSION_NAME> <SELECTION_TYPE><HIDDEN/></SELECTION_TYPE>

</SELECTIONS>

</SELECTION>

<SELECTION>

<SELECTIONS>

<DIMENSION_NAME>BirthOccurResUt?</DIMENSION_NAME> <SELECTION_TYPE><HIDDEN/></SELECTION_TYPE>

</SELECTIONS>

</SELECTION>

</SELECTIONS>

Due to the limitations of HTML this option is only available for radio and checkbox items. So selections that use a LIST can NOT use this mechanism as HTML does not support request parameters with different names within a list. Text input box definitions are of course okay - but they don't need this mechanism.

The way this works is that if the SELECTION contains a SELECTIONS/SELECTION_TYPE/HIDDEN element then all the associated DIMENSION VALUE elements (that do NOT have a NOT_ASSOCIATED_FLAG element and are not EXCLUDED) are coded in HTML as a nested hidden input element. The submitQuery javascript will then clear the hidden's value if the associated parent container checkbox/radio is not selected.

IMPORTANT ISSUE: with this approach if the user presses the back button and then reselects a different value the query will not filter correctly as the user selected hidden value was cleared via the previous submit. However, this is not a huge problem as the user will be able to see that the selection was cleared and all they need to do is return to the builder page as normal (which causes a correct, uncleared page to be returned to the user's browser). OTHER SOLUTIONS: 1) Do a sophisticated check in the controller for proxied values that do not have anything selected/associated with them. This would be a fair amount of coding as to detect and then to walk the XML tree. The nice thing is that the back button work and is not dependent on any script to clear non selected values. If we do this we might want to consider the clearing function be 100% moved to the backend. This will result in more parameters being submitted and will impact backend processing time a little.

2) Clientside flags and script. This is messy and not as clean as the above but could work.

UPDATE: As of 2.1.1 (9/9/2012) the XSLT code was updated to handle default selections by simply setting the proxy without having to set the hidden type values. When the query is submitted these hidden type values will be set by the Java controller modelmap code. This simple change just makes things a little easier for a qm developer to set a default hidden value.

Last edited 7 years ago by Garth Braithwaite (previous) (diff)

comment:2 Changed 7 years ago by Garth Braithwaite

Milestone: 2.1 - Testing

comment:3 Changed 7 years ago by Tong Zheng

The value of dimension is controlled by dimension file --> <Not_Associated_FLag>.

comment:4 Changed 7 years ago by Tong Zheng

Resolution: Fixed
Status: newclosed

comment:5 Changed 7 years ago by Garth Braithwaite

Resolution: Fixed
Status: closedreopened

comment:6 Changed 7 years ago by Garth Braithwaite

Status: reopenednew

comment:7 Changed 7 years ago by Tong Zheng

Owner: changed from Testing to Tong Zheng
Status: newassigned

comment:8 Changed 7 years ago by Tong Zheng

Resolution: Fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.