dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #11305
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 3198: finish template/validation separation in dhis-web-validationrule
------------------------------------------------------------
revno: 3198
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2011-03-29 10:15:49 +0200
message:
finish template/validation separation in dhis-web-validationrule
added:
dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/javascript/addValidationRuleForm.js
dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/javascript/addValidationRuleGroupForm.js
dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/javascript/updateValidationRuleForm.js
dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/javascript/updateValidationRuleGroupForm.js
modified:
dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/validationRules.js
dhis-2/dhis-web/dhis-web-validationrule/src/main/resources/struts.xml
dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/addValidationRuleForm.vm
dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/addValidationRuleGroupForm.vm
dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/updateValidationRuleForm.vm
dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/updateValidationRuleGroupForm.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-commons-resources/src/main/webapp/dhis-web-commons/javascripts/validationRules.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/validationRules.js 2011-03-28 17:46:09 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/validationRules.js 2011-03-29 08:15:49 +0000
@@ -36,91 +36,109 @@
},
/* dhis-web-maintenance-organisationunit */
- "organisationUnit": {
- "name": {
- "rangelength": [2, 160]
- },
- "shortName": {
- "rangelength": [2, 25]
- },
- "code": {
- "rangelength": [0, 25]
- },
- "url": {
- "rangelength": [0, 255]
- },
- "contactPerson": {
- "rangelength": [0, 255]
- },
- "address": {
- "rangelength": [0, 255]
- },
- "email": {
- "rangelength": [0, 250]
- },
- "phoneNumber": {
- "rangelength": [0, 255]
- }
- },
- "organisationUnitGroup": {
- "name": {
- "rangelength": [2, 160]
- }
- },
- "organisationUnitGroupSet": {
- "name": {
- "rangelength": [2, 230]
- },
- "description": {
- "rangelength": [2, 255]
- }
- },
-
+ "organisationUnit" : {
+ "name" : {
+ "rangelength" : [ 2, 160 ]
+ },
+ "shortName" : {
+ "rangelength" : [ 2, 25 ]
+ },
+ "code" : {
+ "rangelength" : [ 0, 25 ]
+ },
+ "url" : {
+ "rangelength" : [ 0, 255 ]
+ },
+ "contactPerson" : {
+ "rangelength" : [ 0, 255 ]
+ },
+ "address" : {
+ "rangelength" : [ 0, 255 ]
+ },
+ "email" : {
+ "rangelength" : [ 0, 250 ]
+ },
+ "phoneNumber" : {
+ "rangelength" : [ 0, 255 ]
+ }
+ },
+ "organisationUnitGroup" : {
+ "name" : {
+ "rangelength" : [ 2, 160 ]
+ }
+ },
+ "organisationUnitGroupSet" : {
+ "name" : {
+ "rangelength" : [ 2, 230 ]
+ },
+ "description" : {
+ "rangelength" : [ 2, 255 ]
+ }
+ },
+
/* dhis-web-maintenance-dataset */
- "dataEntry": {
- "name": {
- "rangelength": [4, 100]
- }
- },
- "section": {
- "name": {
- "rangelength": [2, 160]
- },
- "selectedList": {
-
- }
- },
- "dataSet": {
- "name": {
- "alphanumericwithbasicpuncspaces": true,
- "firstletteralphabet": false,
- "rangelength": [4, 150]
- },
- "shortName": {
- "alphanumericwithbasicpuncspaces": true,
- "firstletteralphabet": false,
- "rangelength": [2, 20]
- },
- "code": {
- "alphanumericwithbasicpuncspaces": true,
- "notOnlyDigits": false,
- "rangelength": [4, 40]
- }
- },
-
+ "dataEntry" : {
+ "name" : {
+ "rangelength" : [ 4, 100 ]
+ }
+ },
+ "section" : {
+ "name" : {
+ "rangelength" : [ 2, 160 ]
+ },
+ "selectedList" : {
+
+ }
+ },
+ "dataSet" : {
+ "name" : {
+ "alphanumericwithbasicpuncspaces" : true,
+ "firstletteralphabet" : false,
+ "rangelength" : [ 4, 150 ]
+ },
+ "shortName" : {
+ "alphanumericwithbasicpuncspaces" : true,
+ "firstletteralphabet" : false,
+ "rangelength" : [ 2, 20 ]
+ },
+ "code" : {
+ "alphanumericwithbasicpuncspaces" : true,
+ "notOnlyDigits" : false,
+ "rangelength" : [ 4, 40 ]
+ }
+ },
+
/* dhis-web-maintenance-dataadmin */
- "sqlView": {
- "name": {
- "rangelength": [2, 50]
- },
- "description": {
- "rangelength": [2, 255]
- },
- "sqlquery": {
- "rangelength": [1, 255]
- }
- },
- "dataLocking": { },
- "dataBrowser": { },
- "minMax": { }
+ "sqlView" : {
+ "name" : {
+ "rangelength" : [ 2, 50 ]
+ },
+ "description" : {
+ "rangelength" : [ 2, 255 ]
+ },
+ "sqlquery" : {
+ "rangelength" : [ 1, 255 ]
+ }
+ },
+ "dataLocking" : {},
+ "dataBrowser" : {},
+ "minMax" : {},
+
+ /* dhis-web-validationrule */
+ "validationRule" : {
+ "name" : {
+ "rangelength" : [ 2, 160 ]
+ },
+ "description" : {
+ "rangelength" : [ 2, 160 ]
+ }
+ },
+ "validationRuleGroup" : {
+ "name" : {
+ "rangelength" : [ 2, 160 ]
+ },
+ "description" : {
+ "rangelength" : [ 2, 160 ]
+ }
+ }
}
=== modified file 'dhis-2/dhis-web/dhis-web-validationrule/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-validationrule/src/main/resources/struts.xml 2011-03-01 04:17:29 +0000
+++ dhis-2/dhis-web/dhis-web-validationrule/src/main/resources/struts.xml 2011-03-29 08:15:49 +0000
@@ -33,7 +33,7 @@
<result name="success" type="velocity">/main.vm</result>
<param name="page">/dhis-web-validationrule/addValidationRuleForm.vm</param>
<param name="menu">/dhis-web-validationrule/menu.vm</param>
- <param name="javascripts">javascript/general.js,javascript/validationForm.js,javascript/expression.js</param>
+ <param name="javascripts">javascript/general.js,javascript/validationForm.js,javascript/expression.js, javascript/addValidationRuleForm.js</param>
<param name="requiredAuthorities">F_VALIDATIONRULE_ADD</param>
</action>
@@ -66,7 +66,7 @@
<action name="showUpdateValidationRuleFormChain" class="org.hisp.dhis.validationrule.action.GetValidationRuleAction">
<result name="success" type="velocity">/main.vm</result>
<param name="page">/dhis-web-validationrule/updateValidationRuleForm.vm</param>
- <param name="javascripts">javascript/general.js,javascript/validationForm.js,javascript/expression.js</param>
+ <param name="javascripts">javascript/general.js,javascript/validationForm.js,javascript/expression.js, javascript/updateValidationRuleForm.js</param>
<param name="requiredAuthorities">F_VALIDATIONRULE_UPDATE</param>
</action>
@@ -103,10 +103,10 @@
<action name="showAddValidationRuleGroupForm" class="org.hisp.dhis.validationrule.action.validationrulegroup.GetValidationRuleGroupMembersAction">
<result name="success" type="velocity">/main.vm</result>
<param name="page">/dhis-web-validationrule/addValidationRuleGroupForm.vm</param>
- <param name="javascripts">javascript/validationRuleGroup.js</param>
+ <param name="javascripts">javascript/validationRuleGroup.js, javascript/addValidationRuleGroupForm.js</param>
<param name="requiredAuthorities">F_VALIDATIONRULEGROUP_ADD</param>
</action>
-
+
<action name="addValidationRuleGroup" class="org.hisp.dhis.validationrule.action.validationrulegroup.AddValidationRuleGroupAction">
<result name="success" type="redirect">showValidationRuleGroupForm.action</result>
<param name="requiredAuthorities">F_VALIDATIONRULEGROUP_ADD</param>
@@ -120,7 +120,7 @@
<action name="getGroupMembersAndAvailableValidationRules" class="org.hisp.dhis.validationrule.action.validationrulegroup.GetValidationRuleGroupMembersAction">
<result name="success" type="velocity">/main.vm</result>
<param name="page">/dhis-web-validationrule/updateValidationRuleGroupForm.vm</param>
- <param name="javascripts">javascript/validationRuleGroup.js</param>
+ <param name="javascripts">javascript/validationRuleGroup.js, javascript/updateValidationRuleGroupForm.js</param>
</action>
<action name="updateValidationRuleGroup" class="org.hisp.dhis.validationrule.action.validationrulegroup.UpdateValidationRuleGroupAction">
=== modified file 'dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/addValidationRuleForm.vm'
--- dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/addValidationRuleForm.vm 2011-03-18 14:58:26 +0000
+++ dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/addValidationRuleForm.vm 2011-03-29 08:15:49 +0000
@@ -1,19 +1,3 @@
-<script type="text/javascript">
- //-----------------------------------------------------------------------
- //init jQuery validation for addValidationRuleForm
- //-----------------------------------------------------------------------
- jQuery(document).ready(function() {
- jQuery("#name").focus();
-
- // validation form
- validation( 'addValidationRuleForm', function( form ){
- form.submit();
- });
-
- checkValueIsExist( "name", "validateValidationRule.action");
- });
-</script>
-
<h3>$encoder.htmlEncode( $i18n.getString( "create_new_validation_rule" ) )</h3>
<form id="addValidationRuleForm" action="addValidationRule.action" method="post" onsubmit="enable('periodTypeName');">
@@ -23,11 +7,11 @@
</tr>
<tr>
<td><label for="name">$encoder.htmlEncode( $i18n.getString( "name" ) ) <em title="$i18n.getString( "required" )" class="required">*</em></label></td>
- <td><input type="text" id="name" name="name" style="width:20em" maxlength="160" class="{validate:{required:true,minlength:2,maxlength:160}}"></td>
+ <td><input type="text" id="name" name="name" style="width:20em"></td>
</tr>
<tr>
<td><label for="description">$encoder.htmlEncode( $i18n.getString( "description" ) )</label></td>
- <td><textarea name="description" style="width:20em; height:6em" class="{validate:{maxlength:255}}"></textarea></td>
+ <td><textarea name="description" style="width:20em; height:6em"></textarea></td>
</tr>
<tr>
<td><label for="periodType">$encoder.htmlEncode( $i18n.getString( "period_type" ) )<em title="$i18n.getString( "required" )" class="required">*</em></label></td>
@@ -43,7 +27,7 @@
<tr>
<td><label for="operatorId">$encoder.htmlEncode( $i18n.getString( "operator" ) ) <em title="$i18n.getString( "required" )" class="required">*</em></label></td>
<td>
- <select id="operator" name="operator" style="width:20em" class="{validate:{required:true}}">
+ <select id="operator" name="operator" style="width:20em">
<option value="">[ $i18n.getString( "select_operator" ) ]</option>
<option value="equal_to">$encoder.htmlEncode( $i18n.getString( "equal_to" ) )</option>
<option value="not_equal_to">$encoder.htmlEncode( $i18n.getString( "not_equal_to" ) )</option>
@@ -59,11 +43,11 @@
<td>
<input type="button" value="$i18n.getString( 'edit_left_side' )" style="width:10em" onclick="editLeftExpression();">
<input type="hidden" id="leftSideDescription" name="leftSideDescription">
- <input type="hidden" id="leftSideExpression" name="leftSideExpression" class="{validate:{required:true}}">
+ <input type="hidden" id="leftSideExpression" name="leftSideExpression">
<input type="hidden" id="leftSideTextualExpression" name="leftSideTextualExpression">
<input type="button" value="$i18n.getString( 'edit_right_side' )" style="width:10em" onclick="editRightExpression();"></td>
<input type="hidden" id="rightSideDescription" name="rightSideDescription">
- <input type="hidden" id="rightSideExpression" name="rightSideExpression" class="{validate:{required:true}}">
+ <input type="hidden" id="rightSideExpression" name="rightSideExpression">
<input type="hidden" id="rightSideTextualExpression" name="rightSideTextualExpression">
</td>
</tr>
@@ -71,7 +55,8 @@
<td></td>
<td>
<input type="submit" value="$i18n.getString( 'save' )" style="width:10em">
- <input type="button" value="$i18n.getString( 'cancel' )" id="cancel" name="cancel" onclick="window.location.href='showValidationRuleForm.action'" style="width:10em"></td>
+ <input type="button" value="$i18n.getString( 'cancel' )" id="cancel" name="cancel" onclick="window.location.href='showValidationRuleForm.action'" style="width:10em">
+ </td>
</tr>
</table>
=== modified file 'dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/addValidationRuleGroupForm.vm'
--- dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/addValidationRuleGroupForm.vm 2011-03-18 14:58:26 +0000
+++ dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/addValidationRuleGroupForm.vm 2011-03-29 08:15:49 +0000
@@ -1,19 +1,4 @@
<script type="text/javascript">
- //-----------------------------------------------------------------------
- //init jQuery validation for addValidationRuleGroupForm
- //-----------------------------------------------------------------------
- jQuery(document).ready(function() {
- jQuery("#name").focus();
-
- validation( 'addValidationRuleGroupForm', function( form ){ form.submit() },
- function(){ selectAllById('groupMembers')
- });
-
- checkValueIsExist( "name", "validateValidationRuleGroup.action");
-
- initLists();
- });
-
var groupMembers = new Object();
#foreach( $validationRule in $groupMembers )
groupMembers['$validationRule.id'] = '$encoder.jsEscape( $validationRule.name, "'" )';
@@ -35,11 +20,11 @@
</tr>
<tr>
<td><label for="name">$i18n.getString( "name" ) <em title="$i18n.getString( "required" )" class="required">*</em></label></td>
- <td><input type="text" id="name" name="name" style="width:20em" maxlength="160" class="{validate:{required:true,minlength:2,maxlength:160}}" ></td>
+ <td><input type="text" id="name" name="name" style="width:20em" /></td>
</tr>
<tr>
<td><label for="description">$i18n.getString( "description" )<em title="$i18n.getString( "required" )" class="required">*</em></label></td>
- <td><input type="text" id="description" name="description" style="width:20em" class="{validate:{required:true,minlength:2,maxlength:160}}"></td>
+ <td><input type="text" id="description" name="description" style="width:20em" /></td>
</tr>
<tr>
<td colspan="2"> </td>
=== added file 'dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/javascript/addValidationRuleForm.js'
--- dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/javascript/addValidationRuleForm.js 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/javascript/addValidationRuleForm.js 2011-03-29 08:15:49 +0000
@@ -0,0 +1,38 @@
+jQuery(document).ready(function() {
+ jQuery("#name").focus();
+
+ var r = getValidationRules();
+
+ var rules = {
+ name : {
+ required : true,
+ rangelength : r.validationRule.name.rangelength
+ },
+ description : {
+ rangelength : r.validationRule.description.rangelength
+ },
+ periodTypeName : {
+ required : true
+ },
+ operator : {
+ required : true
+ },
+ leftSideExpression : {
+ required : true
+ },
+ rightSideExpression : {
+ required : true
+ }
+ };
+
+ validation2('addValidationRuleForm', function(form) {
+ form.submit();
+ }, {
+ 'rules' : rules
+ });
+
+ jQuery("#name").attr("maxlength", r.validationRule.name.rangelength[1]);
+ jQuery("#description").attr("maxlength", r.validationRule.description.rangelength[1]);
+
+ checkValueIsExist("name", "validateValidationRule.action");
+});
=== added file 'dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/javascript/addValidationRuleGroupForm.js'
--- dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/javascript/addValidationRuleGroupForm.js 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/javascript/addValidationRuleGroupForm.js 2011-03-29 08:15:49 +0000
@@ -0,0 +1,31 @@
+jQuery(document).ready(function() {
+ jQuery("#name").focus();
+
+ var r = getValidationRules();
+
+ var rules = {
+ name : {
+ required : true,
+ rangelength : r.validationRuleGroup.name.rangelength
+ },
+ description : {
+ rangelength : r.validationRuleGroup.description.rangelength
+ }
+ };
+
+ validation2('addValidationRuleGroupForm', function(form) {
+ form.submit()
+ }, {
+ 'beforeValidateHandler' : function() {
+ selectAllById('groupMembers')
+ },
+ 'rules' : rules
+ });
+
+ jQuery("#name").attr("maxlength", r.validationRuleGroup.name.rangelength[1]);
+ jQuery("#description").attr("maxlength", r.validationRuleGroup.description.rangelength[1]);
+
+ checkValueIsExist("name", "validateValidationRuleGroup.action");
+
+ initLists();
+});
=== added file 'dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/javascript/updateValidationRuleForm.js'
--- dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/javascript/updateValidationRuleForm.js 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/javascript/updateValidationRuleForm.js 2011-03-29 08:15:49 +0000
@@ -0,0 +1,40 @@
+jQuery(document).ready( function() {
+ jQuery("#name").focus();
+
+ var r = getValidationRules();
+
+ var rules = {
+ name : {
+ required : true,
+ rangelength : r.validationRule.name.rangelength
+ },
+ description : {
+ rangelength : r.validationRule.description.rangelength
+ },
+ periodTypeName : {
+ required : true
+ },
+ operator : {
+ required : true
+ },
+ leftSideExpression : {
+ required : true
+ },
+ rightSideExpression : {
+ required : true
+ }
+ };
+
+ validation2('updateValidationRuleForm', function(form) {
+ form.submit();
+ }, {
+ 'rules' : rules
+ });
+
+ jQuery("#name").attr("maxlength", r.validationRule.name.rangelength[1]);
+ jQuery("#description").attr("maxlength", r.validationRule.description.rangelength[1]);
+
+ checkValueIsExist("name", "validateValidationRule.action", {
+ id : getFieldValue('id')
+ });
+});
=== added file 'dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/javascript/updateValidationRuleGroupForm.js'
--- dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/javascript/updateValidationRuleGroupForm.js 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/javascript/updateValidationRuleGroupForm.js 2011-03-29 08:15:49 +0000
@@ -0,0 +1,33 @@
+jQuery(document).ready(function() {
+ jQuery("#name").focus();
+
+ var r = getValidationRules();
+
+ var rules = {
+ name : {
+ required : true,
+ rangelength : r.validationRuleGroup.name.rangelength
+ },
+ description : {
+ rangelength : r.validationRuleGroup.description.rangelength
+ }
+ };
+
+ validation2('updateValidationRuleGroupForm', function(form) {
+ form.submit()
+ }, {
+ 'beforeValidateHandler' : function() {
+ selectAllById('groupMembers')
+ },
+ 'rules' : rules
+ });
+
+ jQuery("#name").attr("maxlength", r.validationRuleGroup.name.rangelength[1]);
+ jQuery("#description").attr("maxlength", r.validationRuleGroup.description.rangelength[1]);
+
+ checkValueIsExist("name", "validateValidationRuleGroup.action", {
+ id : getFieldValue('id')
+ });
+
+ initLists();
+});
=== modified file 'dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/updateValidationRuleForm.vm'
--- dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/updateValidationRuleForm.vm 2011-03-18 14:58:26 +0000
+++ dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/updateValidationRuleForm.vm 2011-03-29 08:15:49 +0000
@@ -1,22 +1,4 @@
<script type="text/javascript">
- //-----------------------------------------------------------------------
- //init jQuery validation for updateValidationRuleForm
- //-----------------------------------------------------------------------
- jQuery(document).ready(function() {
- jQuery("#name").focus();
-
- // validation form
- validation( 'updateValidationRuleForm', function( form ){
- form.submit();
- });
- /* validation( 'updateValidationRuleForm', function( form ){
- form.submit();
- },function(){
- validateExpression();
- }); */
- checkValueIsExist( "name", "validateValidationRule.action", {id:getFieldValue('id')});
- });
-
var i18n_description_not_null = '$encoder.jsEscape( $i18n.getString( "description_not_null" ) , "'")';
var i18n_expression_not_null = '$encoder.jsEscape( $i18n.getString( "expression_not_null" ) , "'")';
</script>
@@ -35,11 +17,11 @@
</tr>
<tr>
<td><label for="name">$encoder.htmlEncode( $i18n.getString( "name" ) ) <em title="$i18n.getString( "required" )" class="required">*</em></label></td>
- <td><input type="text" id="name" name="name" value="$!encoder.htmlEncode( $validationRule.name )" style="width:20em" maxlength="160" class="{validate:{required:true,minlength:2,maxlength:160}}"></td>
+ <td><input type="text" id="name" name="name" value="$!encoder.htmlEncode( $validationRule.name )" style="width:20em"></td>
</tr>
<tr>
<td><label for="description">$encoder.htmlEncode( $i18n.getString( "description" ) )</label></td>
- <td><textarea name="description" style="width:20em; height:6em" class="{validate:{maxlength:255}}">$!encoder.htmlEncode( $validationRule.description )</textarea></td>
+ <td><textarea name="description" style="width:20em; height:6em">$!encoder.htmlEncode( $validationRule.description )</textarea></td>
</tr>
<tr>
<td><label for="periodType">$encoder.htmlEncode( $i18n.getString( "period_type" ) )<em title="$i18n.getString( "required" )" class="required">*</em></label></td>
@@ -69,10 +51,10 @@
<td>
<input type="button" value="$i18n.getString( 'edit_left_side' )" style="width:10em" onclick="editLeftExpression();">
<input type="hidden" id="leftSideDescription" name="leftSideDescription" value="$!validationRule.leftSide.description">
- <input type="hidden" id="leftSideExpression" name="leftSideExpression" value="$!validationRule.leftSide.expression" class="{validate:{required:true}}">
+ <input type="hidden" id="leftSideExpression" name="leftSideExpression" value="$!validationRule.leftSide.expression">
<input type="hidden" id="leftSideTextualExpression" name="leftSideTextualExpression" value="$!leftSideTextualExpression"">
<input type="button" value="$i18n.getString( 'edit_right_side' )" style="width:10em" onclick="editRightExpression();"></td>
- <input type="hidden" id="rightSideDescription" name="rightSideDescription" value="$!validationRule.rightSide.description" class="{validate:{required:true}}">
+ <input type="hidden" id="rightSideDescription" name="rightSideDescription" value="$!validationRule.rightSide.description">
<input type="hidden" id="rightSideExpression" name="rightSideExpression" value="$!validationRule.rightSide.expression">
<input type="hidden" id="rightSideTextualExpression" name="rightSideTextualExpression" value="$!rightSideTextualExpression">
</tr>
=== modified file 'dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/updateValidationRuleGroupForm.vm'
--- dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/updateValidationRuleGroupForm.vm 2011-03-18 14:58:26 +0000
+++ dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/updateValidationRuleGroupForm.vm 2011-03-29 08:15:49 +0000
@@ -1,19 +1,4 @@
<script type="text/javascript">
- //-----------------------------------------------------------------------
- //init jQuery validation for updateValidationRuleGroupForm
- //-----------------------------------------------------------------------
- jQuery(document).ready(function() {
- jQuery("#name").focus();
-
- validation( 'updateValidationRuleGroupForm',
- function( form ){ form.submit() },
- function(){ selectAllById('groupMembers') });
-
- checkValueIsExist( "name", "validateValidationRuleGroup.action", {id:getFieldValue('id')});
-
- initLists();
- });
-
var groupMembers = new Object();
#foreach( $validationRule in $groupMembers )
groupMembers['$validationRule.id'] = '$encoder.jsEscape( $validationRule.name, "'" )';
@@ -39,11 +24,11 @@
</tr>
<tr>
<td><label for="name">$i18n.getString( "name" ) <em title="$i18n.getString( "required" )" class="required">*</em></label></td>
- <td><input type="text" id="name" name="name" value="$encoder.htmlEncode( $validationRuleGroup.name )" style="width:20em" maxlength="160" class="{validate:{required:true,minlength:2,maxlength:160}}"></td>
+ <td><input type="text" id="name" name="name" value="$encoder.htmlEncode( $validationRuleGroup.name )" style="width:20em"></td>
</tr>
<tr>
<td><label for="description">$i18n.getString( "description" )<em title="$i18n.getString( "required" )" class="required">*</em></label></td>
- <td><input type="text" id="description" name="description" value="$encoder.htmlEncode( $validationRuleGroup.description )" style="width:20em" class="{validate:{required:true,minlength:2,maxlength:160}}"></td>
+ <td><input type="text" id="description" name="description" value="$encoder.htmlEncode( $validationRuleGroup.description )" style="width:20em"></td>
</tr>
<tr>
<td colspan="2"> </td>