dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #32047
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 16373: Add search-field for option-values of optionsets which are assigned for attribute in Aggregate qu...
------------------------------------------------------------
revno: 16373
committer: Tran Chau<tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2014-08-11 19:53:29 +0700
message:
Add search-field for option-values of optionsets which are assigned for attribute in Aggregate query builder.
modified:
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetOptionsByDataElementAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/resources/META-INF/dhis/beans.xml
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/resources/org/hisp/dhis/trackedentity/i18n_module.properties
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/resources/struts.xml
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/caseAggregationForm.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/javascript/caseaggregation.js
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/jsonParamsByProgram.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/jsonTrackedEntityDataElements.vm
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetOptionsByDataElementAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetOptionsByDataElementAction.java 2014-07-29 08:52:03 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetOptionsByDataElementAction.java 2014-08-11 12:53:29 +0000
@@ -55,22 +55,12 @@
// Dependencies
// -------------------------------------------------------------------------
+ @Autowired
private OptionService optionService;
@Autowired
- public void setOptionService( OptionService optionService )
- {
- this.optionService = optionService;
- }
-
private DataElementService dataElementService;
- @Autowired
- public void setDataElementService( DataElementService dataElementService )
- {
- this.dataElementService = dataElementService;
- }
-
// -------------------------------------------------------------------------
// Input
// -------------------------------------------------------------------------
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/resources/META-INF/dhis/beans.xml 2014-07-27 12:49:21 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/resources/META-INF/dhis/beans.xml 2014-08-11 12:53:29 +0000
@@ -804,6 +804,12 @@
<property name="dataSetService" ref="org.hisp.dhis.dataset.DataSetService" />
<property name="dataElementService" ref="org.hisp.dhis.dataelement.DataElementService" />
</bean>
+
+ <bean
+ id="org.hisp.dhis.trackedentity.action.caseaggregation.GetOptionsAction"
+ class="org.hisp.dhis.trackedentity.action.caseaggregation.GetOptionsAction"
+ scope="prototype">
+ </bean>
<!-- Validation - ValidationCriteria -->
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/resources/org/hisp/dhis/trackedentity/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/resources/org/hisp/dhis/trackedentity/i18n_module.properties 2014-08-06 15:20:54 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/resources/org/hisp/dhis/trackedentity/i18n_module.properties 2014-08-11 12:53:29 +0000
@@ -501,4 +501,6 @@
selected_indicators = Selected indicators
program_indicator_management_form = Program indicator management form
auto_save_tracked_entity_registration_forms = Auto-save tracked entity registration forms
-filter_by_program = Filter by program
\ No newline at end of file
+filter_by_program = Filter by program
+enter_an_attribute = Enter an attribute
+enter_a_key = Enter a key
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/resources/struts.xml 2014-07-27 12:49:21 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/resources/struts.xml 2014-08-11 12:53:29 +0000
@@ -793,6 +793,13 @@
</result>
<param name="onExceptionReturn">plainTextError</param>
</action>
+
+ <action name="getOptions"
+ class="org.hisp.dhis.trackedentity.action.caseaggregation.GetOptionsAction">
+ <result name="success" type="velocity-json">
+ /dhis-web-maintenance-program/jsonOptions.vm
+ </result>
+ </action>
<!-- Validation - ValidationCriteria -->
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/caseAggregationForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/caseAggregationForm.vm 2014-08-06 15:20:54 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/caseAggregationForm.vm 2014-08-11 12:53:29 +0000
@@ -33,7 +33,7 @@
</tr>
<tr>
<td colspan='2'>
- <select id="dataElements" name="dataElements" size="8" ondblclick="insertDataElement(this);" onclick="getSuggestedValues(this.id, 'suggestedDEValues' )"></select>
+ <select id="dataElements" name="dataElements" size="8" ondblclick="insertDataElement(this);" onclick="getSuggestedValues(this, 'suggestedDEValues' )"></select>
<select id="dataElementBackups" name="dataElementBackups" style='display:none;'></select>
</td>
<td rowspan='4'>
@@ -69,31 +69,51 @@
<div id="tab-2">
<table>
<tr>
- <td><label>$i18n.getString( "tracked_entity_attributes" )</label></td>
+ <td>$i18n.getString('filter_by_name')
+ <input style="width:180px;" type='text' id='txtSearchAttribue' name='txtSearchAttribue' placeholder="$i18n.getString('enter_an_attribute')" onKeyUp="filterAttribute(event, this.value, 'caseProperty','casePropertyBackups');"/>
+ <a style='width:20px; margin-bottom:-5px;height:20px;' id='attributesButton' name='attributesButton'></a>
+ <input type='button' value='$i18n.getString("clear")' onClick="setFieldValue('txtSearchAttribue', '');" style='width:50px'>
+ </td>
<td>
<label>$i18n.getString( "available_values" )</label>
- <input type='button' title="$i18n.getString( 'insert_selected_values' )" value="»" class="small-button" onClick="insertMultiValues('caSuggestedValues');" >
- </td>
- </tr>
- <tr>
- <td>
- <select id="caseProperty" name="caseProperty" size="10" ondblclick="insertInfo(this, false);" onclick="getSuggestedValues(this.id, 'caSuggestedValues' )">
- #foreach($attribute in $attributes)
- #if($attribute.valueType=='age')
- #set($attId=$attribute.id + ".age")
- #set($attVisitId=$attribute.id + ".visit")
- <option suggested="" title="$attribute.displayName" value="[CA:$attId]">$attribute.displayName ($i18n.getString('ages'))</option>
- <option value="[PS:*] AND [CA:$attVisitId]" name="multiProgram">$attribute.displayName ($i18n.getString( "age_at_visit_days_since_birth" ))</option>
- #else
- <option suggested="" title="$attribute.displayName" value="[CA:$attribute.id]">$attribute.displayName</option>
- #end
- #end
- </select>
- </td>
- <td>
- <select multiple size="10" id='caSuggestedValues' ondblclick="insertSingleValue('caSuggestedValues');"></select>
- </td>
- </tr>
+ <input type="text" disabled placeholder="$i18n.getString('enter_a_key')" id="caSuggestedValues" name="caSuggestedValues" ondblclick="insertSingleValue('caSuggestedValues');" style="width:200px;">
+ </td>
+ </tr>
+ <tr>
+ <td rowspan='2'>
+ <select id='casePropertyBackups' name='casePropertyBackups' style='display:none;'>
+ #foreach($attribute in $attributes)
+ #if($attribute.valueType=='age')
+ #set($attId=$attribute.id + ".age")
+ #set($attVisitId=$attribute.id + ".visit")
+ <option optionSet="$!attribute.optionSet.uid" title="$attribute.displayName" value="[CA:$attId]">$attribute.displayName ($i18n.getString('ages'))</option>
+ <option optionSet="$!attribute.optionSet.uid" value="[PS:*] AND [CA:$attVisitId]" name="multiProgram">$attribute.displayName ($i18n.getString( "age_at_visit_days_since_birth" ))</option>
+ #else
+ <option optionSet="$!attribute.optionSet.uid" title="$attribute.displayName" value="[CA:$attribute.id]">$attribute.displayName</option>
+ #end
+ #end
+ </select>
+ <select id="caseProperty" name="caseProperty" size="10" ondblclick="insertInfo(this, false);" onclick="getSuggestedValues(this, 'caSuggestedValues' )">
+ #foreach($attribute in $attributes)
+ #if($attribute.valueType=='age')
+ #set($attId=$attribute.id + ".age")
+ #set($attVisitId=$attribute.id + ".visit")
+ <option optionSet="$!attribute.optionSet.uid" optionSet="" title="$attribute.displayName" value="[CA:$attId]">$attribute.displayName ($i18n.getString('ages'))</option>
+ <option optionSet="$!attribute.optionSet.uid" value="[PS:*] AND [CA:$attVisitId]" name="multiProgram">$attribute.displayName ($i18n.getString( "age_at_visit_days_since_birth" ))</option>
+ #else
+ <option optionSet="$!attribute.optionSet.uid" title="$attribute.displayName" value="[CA:$attribute.id]">$attribute.displayName</option>
+ #end
+ #end
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <select multiple id='attributeId' name='attributeId' size=10 ondblclick="removeOption('attributeId')"></select>
+ <input type='button' title="$i18n.getString( 'insert_selected_values' )" value="»" class="small-button" onClick="insertMultiValues('attributeId');" >
+ </td>
+ </tr>
+
</table>
</div>
@@ -161,7 +181,7 @@
<tr>
<td>
<fieldset>
- <legend>$i18n.getString( "condition" )</legend>
+ <legend>$i18n.getString( "condition" ) <em title="$i18n.getString( 'required' )" class="required">*</em></legend>
<table><tr><td>
<textarea id="aggregationCondition" name="aggregationCondition" onkeyup='getConditionDescription();' maxlength="1000">$!caseAggregation.aggregationExpression</textarea>
</td></tr></table>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/javascript/caseaggregation.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/javascript/caseaggregation.js 2014-08-03 16:27:47 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/javascript/caseaggregation.js 2014-08-11 12:53:29 +0000
@@ -141,15 +141,18 @@
getTrackedEntityDataElements();
clearListById('caseProperty');
+ clearListById('casePropertyBackups');
var type = jQuery('#programId option:selected').attr('programType');
if( type != '3' ) {
var caseProperty = jQuery('#caseProperty');
+ var casePropertyBackups = jQuery('#casePropertyBackups');
for( i in json.attributes ) {
var id = json.attributes[i].id;
var name = json.attributes[i].name;
- var suggested = json.attributes[i].suggested;
-
- caseProperty.append("<option value='" + id + "' title='" + name + "' suggested='" + suggested + "'>" + name + "</option>");
+ var optionSet = json.attributes[i].optionSet;
+
+ caseProperty.append("<option value='" + id + "' title='" + name + "' optionSet='" + optionSet + "'>" + name + "</option>");
+ casePropertyBackups.append("<option value='" + id + "' title='" + name + "' optionSet='" + optionSet + "'>" + name + "</option>");
}
}
});
@@ -206,10 +209,10 @@
var deSumId = jQuery('#deSumId');
deSumId.append("<option value='' >" + i18n_please_select + "</option>");
for( i in json.dataElements ) {
- dataElements.append("<option value='" + json.dataElements[i].id + "' title='" + json.dataElements[i].name + "' dename='" + json.dataElements[i].name + "' decode='" + json.dataElements[i].code + "' suggested='" + json.dataElements[i].optionset + "' valuetype='" + json.dataElements[i].type + "'>" + json.dataElements[i].name + "</option>");
- dataElementBackups.append("<option value='" + json.dataElements[i].id + "' title='" + json.dataElements[i].name + "' dename='" + json.dataElements[i].name + "' decode='" + json.dataElements[i].code + "' suggested='" + json.dataElements[i].optionset + "' valuetype='" + json.dataElements[i].type + "'>" + json.dataElements[i].name + "</option>");
+ dataElements.append("<option value='" + json.dataElements[i].id + "' title='" + json.dataElements[i].name + "' dename='" + json.dataElements[i].name + "' decode='" + json.dataElements[i].code + "' optionSet='" + json.dataElements[i].optionset + "' valuetype='" + json.dataElements[i].type + "'>" + json.dataElements[i].name + "</option>");
+ dataElementBackups.append("<option value='" + json.dataElements[i].id + "' title='" + json.dataElements[i].name + "' dename='" + json.dataElements[i].name + "' decode='" + json.dataElements[i].code + "' optionSet='" + json.dataElements[i].optionset + "' valuetype='" + json.dataElements[i].type + "'>" + json.dataElements[i].name + "</option>");
if( json.dataElements[i].type == 'int' ) {
- deSumId.append("<option value='" + json.dataElements[i].id + "' title='" + json.dataElements[i].name + "' suggested='" + json.dataElements[i].optionset + "' valuetype='" + json.dataElements[i].type + "'>" + json.dataElements[i].name + "</option>");
+ deSumId.append("<option value='" + json.dataElements[i].id + "' title='" + json.dataElements[i].name + "' optionSet='" + json.dataElements[i].optionset + "' valuetype='" + json.dataElements[i].type + "'>" + json.dataElements[i].name + "</option>");
}
}
@@ -319,15 +322,15 @@
});
}
-function getSuggestedValues( sourceId, targetId ) {
+function getoptionSetValues( sourceId, targetId ) {
clearListById(targetId);
- var suggestedValues = jQuery('select[id=' + sourceId + '] option:selected').attr('suggested');
- if( suggestedValues ) {
+ var optionSetValues = jQuery('select[id=' + sourceId + '] option:selected').attr('optionSet');
+ if( optionSetValues ) {
var arrValues = new Array();
- arrValues = suggestedValues.replace(/[//[]+/g, '').replace(/]/g, '').split(', ');
+ arrValues = optionSetValues.replace(/[//[]+/g, '').replace(/]/g, '').split(', ');
- var suggestedValueSelector = byId(targetId);
+ var optionSetValueSelector = byId(targetId);
for( var i = 0; i < arrValues.length; i++ ) {
var option = document.createElement("option");
var value = jQuery.trim(arrValues[i]);
@@ -335,7 +338,7 @@
option.text = value;
option.title = value;
- suggestedValueSelector.add(option, null);
+ optionSetValueSelector.add(option, null);
}
}
}
@@ -347,7 +350,7 @@
}
function insertMultiValues( elementId ) {
- var list = jQuery('select[id=' + elementId + '] option:selected')
+ var list = jQuery('select[id=' + elementId + '] option')
if( list.length == 0 ) {
return;
}
@@ -401,16 +404,27 @@
var option = jQuery(this);
if( valueType == '' || valueType == option.attr('valueType') ) {
if( value.length == 0 ) {
- jQuery('#' + fieldName).append("<option value='" + option.attr('value') + "' title='" + option.text() + "' suggested='" + option.attr('suggested') + "' valueType='" + option.attr('valueType') + "'>" + option.text() + "</option>");
+ jQuery('#' + fieldName).append("<option value='" + option.attr('value') + "' title='" + option.text() + "' optionSet='" + option.attr('optionSet') + "' valueType='" + option.attr('valueType') + "'>" + option.text() + "</option>");
}
else if( option.text().toLowerCase().indexOf(value.toLowerCase()) != -1 ) {
- jQuery('#' + fieldName).append("<option value='" + option.attr('value') + "' title='" + option.text() + "' suggested='" + option.attr('suggested') + "' valueType='" + option.attr('valueType') + "'>" + option.text() + "</option>");
+ jQuery('#' + fieldName).append("<option value='" + option.attr('value') + "' title='" + option.text() + "' optionSet='" + option.attr('optionSet') + "' valueType='" + option.attr('valueType') + "'>" + option.text() + "</option>");
}
}
});
}
+function filterAttribute( event, value, fieldName, backupFieldsName ) {
+ // Remove all options in data element fields
+ var field = jQuery('#' + fieldName + " option ").remove();
+ jQuery('#' + backupFieldsName + " option ").each(function() {
+ var option = jQuery(this);
+ if( option.text().toLowerCase().indexOf(value.toLowerCase()) != -1 ) {
+ jQuery('#' + fieldName).append("<option value='" + option.attr('value') + "' title='" + option.attr('value') + "' optionSet='" + option.attr('optionSet') + "' >" + option.text() + "</option>");
+ }
+ });
+}
+
function sortByOnChange( sortBy ) {
if( sortBy == 1 ) {
jQuery('#dataElements').each(function() {
@@ -489,3 +503,114 @@
var dataSetId = getFieldValue("dataSets");
window.location.href = 'caseAggregation.action?dataSetId=' + dataSetId;
}
+
+function attributeAutocompletedField( idField, optionSetUid )
+{
+ $("#attributesButton").unbind('click');
+ enable('attributesButton');
+ var input = jQuery( "#" + idField );
+ var select = jQuery( "#attributeId" );
+ input.autocomplete({
+ delay: 0,
+ minLength: 0,
+ source: function( request, response ) {
+ $.ajax({
+ url: "getOptions.action?id=" + optionSetUid + "&query=" + input.val(),
+ dataType: "json",
+ success: function( data ) {
+ response( $.map( data.options, function ( item ) {
+ return {
+ label: item.n,
+ id: item.c
+ };
+ } ));
+ }
+ });
+ },
+ select: function( event, ui ) {
+ input.val(ui.item.label);
+ jQuery("#attributeId").append( "<option value='" + ui.item.id + "'>" + ui.item.label + "</option>" );
+ input.autocomplete("close");
+
+ return false;
+ },
+ change: function( event, ui ) {
+ if( !ui.item ) {
+ var matcher = new RegExp("^" + $.ui.autocomplete.escapeRegex($(this).val()) + "$", "i"),
+ valid = false;
+ select.children("option").each(function() {
+ if( $(this).text().match(matcher) ) {
+ this.selected = valid = true;
+ return false;
+ }
+ });
+ if( !valid ) {
+ // remove invalid value, as it didn't match anything
+ $(this).val("");
+ select.val("");
+ input.data("uiAutocomplete").term = "";
+ return false;
+ }
+ }
+ }
+ }).addClass("ui-widget");
+
+ input.data("uiAutocomplete")._renderItem = function( ul, item ) {
+ return $("<li></li>")
+ .data("item.autocomplete", item)
+ .append("<a>" + item.label + "</a>")
+ .appendTo(ul);
+ };
+
+ var wrapper = this.wrapper = $("<span style='width:200px'>")
+ .addClass("ui-combobox")
+ .insertAfter(input);
+
+ var button = $("#attributesButton")
+ .attr("tabIndex", -1)
+ .attr("title", i18n_show_all_items)
+ .appendTo(wrapper)
+ .button({
+ icons: {
+ primary: "ui-icon-triangle-1-s"
+ },
+ text: false
+ })
+ .click(function() {
+ // close if already visible
+ if( input.autocomplete("widget").is(":visible") ) {
+ input.autocomplete("close");
+ return;
+ }
+ // work around a bug (likely same cause as #5265)
+ $(this).blur();
+ // pass empty string as value to search for, displaying all results
+ input.autocomplete("search", "");
+ input.focus();
+ });
+}
+
+function split( val ) {
+ return val.split( /,\s*/ );
+}
+
+function getSuggestedValues( _this, suggestedField )
+{
+ clearListById('attributeId');
+ var field = jQuery( '#' + suggestedField );
+ var option = jQuery("#" + _this.id + " option:selected" );
+ if( option.attr('optionset') != "" ){
+ attributeAutocompletedField( suggestedField, option.attr('optionset') );
+ enable(suggestedField);
+ jQuery( '#attributesButton').css("display", "");
+ }
+ else{
+ disable(suggestedField);
+ jQuery( '#attributesButton').css("display", "none");
+ }
+}
+
+function removeOption( elementId )
+{
+ jQuery('#' + elementId + ' option:selected').remove();
+}
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/jsonParamsByProgram.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/jsonParamsByProgram.vm 2014-08-07 14:14:54 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/jsonParamsByProgram.vm 2014-08-11 12:53:29 +0000
@@ -13,16 +13,12 @@
{
"id": "[CA:${attribute.id}]",
"name": "$!encoder.jsonEncode( ${attribute.name} )",
- "suggested":[
- #if( $!dataElement.optionSet )
- #foreach( $opt in $!attribute.optionSet.options )
- {
- "code" : $opt.code,
- "name" : "$encoder.xmlEncode($opt.name)"
- }#if( $velocityCount < $size ),#end
- #end
- #end
- ]
+ "optionSet": #if( $!dataElement.optionSet)
+ "$!dataElement.optionSet.uid"
+ #else
+ ""
+ #end
+
}#if( $velocityCount < $size ),#end
#end
]
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/jsonTrackedEntityDataElements.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/jsonTrackedEntityDataElements.vm 2014-08-07 13:50:27 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/jsonTrackedEntityDataElements.vm 2014-08-11 12:53:29 +0000
@@ -6,16 +6,7 @@
"name": "$!encoder.jsonEncode( ${dataElement.name} )",
"code": "$!encoder.jsonEncode( ${dataElement.code} )",
"type": "${dataElement.type}",
- "optionset": #if( $!dataElement.optionSet )
- [#foreach( $opt in $!dataElement.optionSet.options )
- {
- "code" : "$encoder.jsonEncode($opt.code)",
- "name" : "$encoder.jsonEncode($opt.name)"
- }#if( $velocityCount < $!dataElement.optionSet.options.size() ),#end
- #end]
- #else
- ""
- #end
+ "optionset": #if( $!dataElement.optionSet ) "$!dataElement.optionSet.uid" #else "" #end
}#if( $velocityCount < $size ),#end
#end