Changeset 643
- Timestamp:
- 2008-09-26 13:15:59 (5 years ago)
- Location:
- trunk/modules/kauri-forms/kauri-forms-framework/src
- Files:
-
- 2 added
- 3 edited
-
assembler/kauri-forms-assembler.xml (modified) (1 diff)
-
main/kauri/js/case.js (added)
-
main/kauri/js/control.js (modified) (75 diffs)
-
test/js/test-case.js (added)
-
test/js/testPage.html (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/modules/kauri-forms/kauri-forms-framework/src/assembler/kauri-forms-assembler.xml
r560 r643 25 25 <include>collection.js</include> 26 26 <include>composite.js</include> 27 <include>case.js</include> 27 28 28 29 <include>date.js</include> -
trunk/modules/kauri-forms/kauri-forms-framework/src/main/kauri/js/control.js
r624 r643 21 21 22 22 /** 23 * ControlElements declares the constants and helper methods and instances to handle the control to HTML binding operations of23 * @class ControlElements declares the constants and helper methods and instances to handle the control to HTML binding operations of 24 24 * indexing and finding HTML elements bound to the controls. 25 25 * <p> … … 41 41 } 42 42 43 43 /** 44 * Html attribute name used for specifying an index 45 * @static 46 * @final 47 */ 44 48 ControlElements.ATTR_INDEX = "kauri-index"; 49 50 /** 51 * Html attribute name used for specifying the control id 52 * @static 53 * @final 54 */ 45 55 ControlElements.ATTR_IDREF = "kauri-idref"; 56 57 /** 58 * Html attribute name used for specifying the relation. Rev is short for reverse index 59 * @static 60 * @final 61 */ 46 62 ControlElements.ATTR_REV = "kauri-rev"; 63 64 /** 65 * Specifies that the element has a messages relation with the control 66 * @static 67 * @final 68 */ 47 69 ControlElements.REV_MESSAGES = "messages"; 70 71 /** 72 * Specifies that the element has a label relation with the control 73 * @static 74 * @final 75 */ 48 76 ControlElements.REV_LABEL = "label"; 77 78 /** 79 * Specifies that the element has an input relation with the control. If no relation is specified this is used by default 80 * @static 81 * @final 82 */ 49 83 ControlElements.REV_INPUT = "input"; 84 85 /** 86 * Specifies that the element has a mark relation with the control. 87 * <b>TODO:</b> What does this mark thing do anyway? 88 * @static 89 * @final 90 */ 50 91 ControlElements.REV_MARK = "mark"; 92 93 /** 94 * Specifies that the element is a container for the control 95 * @static 96 * @final 97 */ 51 98 ControlElements.REV_CONTAINER = "container"; 99 100 /** 101 * Specifies that the element should be used as a layout or template for child elements 102 * @static 103 * @final 104 */ 52 105 ControlElements.REV_LAYOUT = "layout"; 106 107 /** 108 * Specifies that the element is a child item of the control 109 * @static 110 * @final 111 */ 53 112 ControlElements.REV_ITEM = "item"; 113 114 /** 115 * Specifies that the element is used for refreshing data 116 * @static 117 * @final 118 */ 54 119 ControlElements.REV_REFRESH = "refresh"; 55 120 … … 58 123 * Indexes the passed 'space' of HTML elements. Indexing in this context means resolving the various relative kauri-rev 59 124 * attributes into absolute kauri-index attributes while keeping the pre-indexed references in the passed elementsIndex. 125 * @param {HTMLElement} space Which html element should be used as the start of indexing, all the child elements of the space will be indexed 126 * @param {ControlElements} store Where the index should be stored 127 * @param {Boolean} forceReIndexing Index even if the space has already been indexed 128 * @static 60 129 */ 61 130 ControlElements.index = function( space, store, forceReIndexing) { … … 104 173 * Finds the element assigned to the identified control for a specific kauri-form-relation (functional role), and creates it if 105 174 * not found. 106 * 175 * @param {Control} control 176 * @param {String} relation What relation the element has with the control (input, message, ...) 177 * @param {Boolean} create Flag that indicates if an element should be created if not found 107 178 * @final 108 179 * @static … … 166 237 /** 167 238 * Regular expression to parse index-entries. 168 * 239 * @type Pattern 169 240 * @static 170 241 * @final … … 174 245 /** 175 246 * Splits the index-expressions in index and relation parts. 176 * 247 * @param {String} index 248 * @return An Object with an index and a relation 249 * @type Object 177 250 * @static 178 251 * @final … … 191 264 /** 192 265 * Builds a new array with 'meta' property to store the associated relation-elements 193 * 266 * @return an empty array 267 * @type Array 194 268 * @static 195 269 * @final … … 204 278 205 279 /** 206 * 280 * Generates a jQuery selector based on the given relationship 281 * @param {String} relation The relationship the element has with the control 282 * @return A selector to be used by jQuery to select certain elements 283 * @type String 284 * @static 285 * @final 207 286 */ 208 287 ControlElements.revSelector = function( relation) { … … 235 314 * 236 315 * @return whatever the idfn or relfn functions return. 316 * @private 237 317 */ 238 318 ControlElements.prototype._operateIndex = function( index, relation, idfn, relfn) { … … 259 339 * @param {string} 260 340 * [relation] relation-part to clear. <code>undefined</code> will force extra parsing of the index looking for a 261 * relation part. <code>false</code> will skip index-parsing and clear the array. 341 * relation part. <code>false</code> will skip index-parsing and clear the array. 262 342 */ 263 343 ControlElements.prototype.clearElementIndex = function( index, relation) { … … 340 420 341 421 /** 342 * Control performs the actual DOM manipulations and event passing for an actual input-control on the form. Pure UI formatting422 * @class Control performs the actual DOM manipulations and event passing for an actual input-control on the form. Pure UI formatting 343 423 * effects (in fact any non data-bound interaction) are not handled by these controls. 344 424 * … … 363 443 /** 364 444 * Initializes all aspects of the control in a well defined sequence. 365 * 445 * @param {Object} conf Control configuration 366 446 * @final should not be overridden 367 447 */ … … 380 460 /** 381 461 * Initializes the 'type' from the configuration object passed in (if that didn't happen yet). 382 * 462 * @param {Object} conf Control configuration 383 463 * @final should not be overridden 384 464 */ … … 396 476 /** 397 477 * Creates the type from the config if that is still needed. 398 * 478 * @param {Object} conf Control configuration 399 479 * @final should not be overridden 400 480 */ … … 408 488 409 489 410 /** Holds the control-bound HTML elements per relation */ 490 /** 491 * Holds the control-bound HTML elements per relation 492 * @private 493 */ 411 494 Control.prototype._elements; 412 495 413 /** Holds the configuration parameters for finding/creation control bound HTML elements per relation */ 496 /** 497 * Holds the configuration parameters for finding/creation control bound HTML elements per relation 498 * @type Object 499 */ 414 500 Control.prototype.elements = { 415 501 messages : { … … 419 505 }; 420 506 507 /** 508 * Initializes element configurations 509 */ 421 510 Control.prototype.initElementConfigs = function() { 422 511 423 512 } 424 513 514 /** 515 * Gets an element configuration attribute based on it's relationship with the control 516 * @param {String} relation The elements relationship with the control 517 * @param {String} attribute Attribute name 518 * @return The sought after attribute 519 * @type Object 520 * @final 521 * @private 522 */ 425 523 Control.prototype._getElementConfig = function( relation, attribute) { 426 524 … … 431 529 } 432 530 531 /** 532 * Gets the element selector for an element with the specified relationship 533 * @param {String} relation The elements relationship with the control 534 * @return The element selector 535 * @type String 536 */ 433 537 Control.prototype.getElementSelector = function( relation) { 434 538 … … 436 540 } 437 541 542 /** 543 * Gets the create statement for an element with the specified relationship 544 * @param {String} relation The elements relationship with the control 545 * @return The create statement 546 * @type String 547 */ 438 548 Control.prototype.getCreateElement = function( relation) { 439 549 … … 441 551 } 442 552 553 /** 554 * Sets a html element (jQuery wrapped) for a specific relationship 555 * @param {String} relation The elements relationship with the control 556 * @param {jQuery} $elm Html element, jQuery wrapped 557 */ 443 558 Control.prototype.setElement = function( relation, $elm) { 444 559 … … 448 563 } 449 564 565 /** 566 * Gets a html element (jQuery) for a specific relationship 567 * @param {String} relation The elements relationship with the control 568 * @return The html element 569 * @type jQuery 570 */ 450 571 Control.prototype.getElement = function( relation) { 451 572 … … 537 658 /** 538 659 * Perform control specific HTML element-binding on containment elements 539 * 660 * @param {Boolean} create Create the elements if they don't exist yet 540 661 * @see #_initElements(create) 541 662 */ … … 546 667 /** 547 668 * Initialize options (lists of possible values) for the control. 669 * @param {Boolean} create Create the option elements if they don't exist yet 548 670 */ 549 671 Control.prototype.initOptions = function(create) { … … 576 698 /** 577 699 * Perform control specific HTML updating of options 700 * @param {Array} values Option values 701 * @param {Array} labels Option labels 578 702 */ 579 703 Control.prototype.updateOptions = function( values, labels) { … … 586 710 /** 587 711 * Perform control specific HTML element-binding. 588 * 712 * @param {Boolean} create Creates the elements if they don't exist yet 589 713 * @see #_initElements(create) 590 714 */ … … 593 717 } 594 718 595 719 /** 720 * Initializes validation i.e. sets validation listeners 721 */ 596 722 Control.prototype.initValidation = function() { 597 723 … … 599 725 }; 600 726 601 /** The input-element which change() event should trigger the update sequence. Undefinef disables update. */ 727 /** 728 * The input-element which change() event should trigger the update sequence. Undefinef disables update. 729 * @return The update element 730 * @type jQuery 731 */ 602 732 Control.prototype.getUpdateElement = function() { 603 733 … … 681 811 * formatting and validation is to be applied. 682 812 */ 683 Control.prototype.update = function() { 684 813 Control.prototype.update = function() { 685 814 var userVal = this.getUserValue(); 686 815 this.updateUserValue(userVal); … … 702 831 } 703 832 833 /** 834 * Specifies that the value state is not yet known 835 * @static 836 * @final 837 */ 704 838 Control.STATE_INIT = undefined; 839 840 /** 841 * Specifies that the value stored in the control has been deemed valid 842 * @static 843 * @final 844 */ 705 845 Control.STATE_VALID = "valid"; 846 847 /** 848 * Specifies that the value stored in the control has been deemed invalid 849 * @static 850 * @final 851 */ 706 852 Control.STATE_INVALID = "invalid"; 853 854 /** 855 * Specifies that validation is in progress 856 * @static 857 * @final 858 */ 707 859 Control.STATE_IN_PROGRESS = "in-progress"; 708 860 861 /** 862 * Specifies that the control is hidded 863 * @static 864 * @final 865 */ 866 Control.STATE_HIDDEN = "hidden"; 867 868 /** 869 * Specifies that the control is visible 870 * @static 871 * @final 872 */ 873 Control.STATE_VISIBLE = "visible"; 874 875 /** 876 * Specifies that the control is enabled 877 * @static 878 * @final 879 */ 880 Control.STATE_ENABLED = "enabled"; 881 882 /** 883 * Specifies that the control has been disabled 884 * @static 885 * @final 886 */ 887 Control.STATE_DISABLED = "disabled"; 888 889 /** 890 * The controls value state. This is used to find out if the contained value is valid or not and all states in between 891 */ 709 892 Control.prototype.valueState = Control.STATE_INIT; 893 894 /** 895 * The controls view state, is it visible or not 896 */ 897 Control.prototype.viewState = Control.STATE_VISIBLE; 898 899 /** 900 * Can a control be manipulated or not, enabled/disabled. 901 */ 902 Control.prototype.operationalState = Control.STATE_ENABLED; 710 903 711 904 /** 712 905 * Sets the user-value and triggers formatting and validating as would actual editing. 906 * @param {Object} userValue 907 * @param {Boolean} noValidation Should validation be done or not 713 908 */ 714 909 Control.prototype.updateUserValue = function( userValue, noValidation) { … … 724 919 } 725 920 921 /** 922 * Handles errors produced by funky values 923 * @param {Error} e The error object 924 */ 726 925 Control.prototype.handleValueError = function( e) { 727 926 … … 731 930 } 732 931 733 Control.prototype.isValid = function(forceValidation) { 734 932 /** 933 * Checks if the control is valid 934 * @param {Boolean} forceValidation Force the validation if the control has been changed or not 935 * @return Is the control valid or not 936 * @type Boolean 937 */ 938 Control.prototype.isValid = function(forceValidation) { 735 939 forceValidation = forceValidation || false; 736 940 … … 741 945 } 742 946 947 /** 948 * Sets the controls value 949 * @param {Object} value 950 * @param {Boolean} noValidation Should validation be done after setting the value? 951 */ 743 952 Control.prototype.setValue = function( value, noValidation) { 744 745 953 noValidation = noValidation || false; 746 954 … … 761 969 }; 762 970 971 /** 972 * Gets the controls value 973 * @return The value 974 * @type Object 975 */ 763 976 Control.prototype.getValue = function() { 764 977 … … 766 979 }; 767 980 981 /** 982 * Gets the controls wirevalue. The wirevalue is the value formatted in a manner that can be communicated to other services 983 * @return the wire value 984 * @type Object 985 */ 768 986 Control.prototype.getWireValue = function() { 769 987 … … 781 999 } 782 1000 1001 /** 1002 * Sets the wire value 1003 * @param {Object} wireValue 1004 */ 783 1005 Control.prototype.setWireValue = function( wireValue) { 784 1006 … … 793 1015 794 1016 /** 1017 * Sets the original value of a control 1018 * @param {Object} value the original value 795 1019 * @private Not meant to be called externally, is called internally as a side effect of setWireValue. 796 1020 */ … … 800 1024 } 801 1025 1026 /** 1027 * Checks if a control has changes 1028 * @return if a controls has changes or not 1029 * @type Boolean 1030 */ 802 1031 Control.prototype.hasChanges = function() { 803 1032 … … 805 1034 } 806 1035 1036 /** 1037 * Checks if the provided value equals the value currently stored in the control 1038 * @param {Object} thatValue The value to check against 1039 * @return equals or not 1040 * @type Boolean 1041 */ 807 1042 Control.prototype.valueEquals = function( thatValue) { 808 1043 … … 813 1048 } 814 1049 1050 /** 1051 * Validates the provided value using the configured validators 1052 * @param {Object} value 1053 */ 815 1054 Control.prototype.newValidation = function( value) { 816 817 1055 if (this.getType().validators.length == 0) { 818 1056 // if there are no validators then we must assume that the control is valid … … 825 1063 } 826 1064 1065 /** 1066 * Gets the validation data 1067 * @return 1068 * @type Object 1069 */ 827 1070 Control.prototype.getValidationData = function() { 828 1071 return {control: this, options: this.getOptionValues()}; 829 1072 } 830 1073 1074 /** 1075 * Retrieve the controls options values 1076 * @return an array of values 1077 * @type Array 1078 */ 831 1079 Control.prototype.getOptionValues = function() { 832 1080 if (this.options == undefined || this.options.getValues == undefined) … … 835 1083 } 836 1084 1085 /** 1086 * What to do when a validation is successful 1087 */ 837 1088 Control.prototype.validationSuccess = function() { 838 1089 839 1090 } 840 1091 1092 /** 1093 * Things to do before the validation begins 1094 */ 841 1095 Control.prototype.validationStart = function() { 842 1096 … … 845 1099 } 846 1100 1101 /** 1102 * Things to do when a validation is complete 1103 */ 847 1104 Control.prototype.validationComplete = function() { 848 1105 … … 863 1120 } 864 1121 1122 /** 1123 * What to do when a validation fails 1124 * @param {String} message What is displayed as a validation failed message 1125 */ 865 1126 Control.prototype.validationFail = function( message) { 866 1127 … … 868 1129 } 869 1130 1131 /** 1132 * Sets a message in the controls message element, if there is any 1133 * @param {String} msg Message to be displayed 1134 */ 870 1135 Control.prototype.setMessage = function( msg) { 871 1136 872 1137 var msgElm = this.getElement("messages"); 873 1138 if (msgElm) { … … 884 1149 } 885 1150 1151 /** 1152 * Clears the controls message 1153 */ 886 1154 Control.prototype.clearMessage = function() { 887 1155 888 1156 this.setMessage(""); 889 1157 } 890 1158 891 1159 /** 1160 * Gives a string representation of the control 1161 * @return a string representation of the control 1162 * @type String 1163 */ 892 1164 Control.prototype.toString = function() { 893 1165 … … 895 1167 }; 896 1168 897 1169 /** 1170 * Gets this controls absolute id. This means including all the ids of possible parent controls 1171 * @return absolute id or id-path 1172 * @type String 1173 */ 898 1174 Control.prototype.getAbsoluteId = function() { 899 1175 … … 908 1184 909 1185 // TODO support 'match-patterns' allowing to return arrays of controls on which some jqyery like each() can then execute 910 1186 /** 1187 * Finds a control by checking it's path. This path can be a string representation or an array of path segments. 1188 * @param {Object} arg {String} path or an {Array} of path segments 1189 * @return A control 1190 * @type Control 1191 */ 911 1192 Control.prototype.findControl = function() { 912 1193 … … 922 1203 } 923 1204 1205 /** 1206 * Finds a control using a string representation of a path 1207 * @param {String} path 1208 * @return A control 1209 * @type Control 1210 */ 924 1211 Control.prototype._findControlByPath = function( path) { 925 1212 … … 929 1216 } 930 1217 1218 /** 1219 * Finds a control using an array of path segments 1220 * @param {Array} path segments 1221 * @return A control 1222 * @type Control 1223 */ 931 1224 Control.prototype._findControlBySegments = function( segments) { 932 1225 … … 947 1240 return target; 948 1241 } 949 950 /** 1242 1243 /** 1244 * Hides all elements in the control 1245 */ 1246 Control.prototype.hide = function () { 1247 for (var rel in this._elements) { 1248 this._elements[rel].hide(); 1249 } 1250 this.viewState = Control.STATE_HIDDEN; 1251 } 1252 1253 /** 1254 * Makes control and all elements in the control visible 1255 */ 1256 Control.prototype.show = function () { 1257 for (var rel in this._elements) { 1258 this._elements[rel].show(); 1259 } 1260 this.viewState = Control.STATE_VISIBLE; 1261 } 1262 1263 /** 1264 * Enables the control for writing 1265 */ 1266 Control.prototype.enable = function () { 1267 for (var rel in this._elements) { 1268 var el = this._elements[rel]; 1269 if (el.is(":disabled")) { 1270 el.removeAttr("disabled"); 1271 } 1272 el.removeClass("disabled"); 1273 } 1274 this.operationalState = Control.STATE_ENABLED; 1275 } 1276 1277 /** 1278 * Disables the control 1279 */ 1280 Control.prototype.disable = function () { 1281 for (var rel in this._elements) { 1282 var el = this._elements[rel]; 1283 if (el.is(":enabled")) { 1284 el.attr("disabled", "disabled"); 1285 } 1286 el.addClass("disabled"); 1287 } 1288 this.operationalState = Control.STATE_DISABLED; 1289 } 1290 1291 /* 951 1292 * GETTERS & SETTERS 952 1293 */ 953 1294 1295 /** 1296 * Gets the controls id 1297 * @return the id 1298 * @type String 1299 */ 954 1300 Control.prototype.getId = function() { 955 1301 … … 957 1303 } 958 1304 1305 /** 1306 * Get the controls form control 1307 * @return a form object 1308 * @type Form 1309 */ 959 1310 Control.prototype.getForm = function() { 960 1311 … … 962 1313 } 963 1314 1315 /** 1316 * Sets the controls field type 1317 * @param {FieldType} type The Field type to be used for this control 1318 */ 964 1319 Control.prototype.setType = function( type) { 965 1320 … … 967 1322 }; 968 1323 1324 /** 1325 * Gets the controls field type 1326 * @return the controls type 1327 * @type FieldType 1328 */ 969 1329 Control.prototype.getType = function() { 970 1330 … … 972 1332 } 973 1333 1334 /** 1335 * Gets the controls parent 1336 * @return the parent control 1337 * @type Control 1338 */ 974 1339 Control.prototype.getParent = function() { 975 1340 … … 979 1344 $.inherit(AbstractContainerControl, Control); 980 1345 1346 /** 1347 * @class The base class to be used by all other container controls 1348 * @extends Control 1349 * @constructor 1350 * @param {String} id. Control Id 1351 * @param {Form} form. The form that should contain this control 1352 * @param {Object} conf. The configuration 1353 */ 981 1354 function AbstractContainerControl( id, form, conf) { 982 1355 … … 984 1357 } 985 1358 1359 /** 1360 * Creates a blank value 1361 * @return a blank value 1362 * @type Object 1363 */ 986 1364 AbstractContainerControl.prototype.newBlankValue = function() { 987 1365 … … 989 1367 }; 990 1368 991 //** Indicates initValue was called from parent already, and should be called on children from now on. 1369 /** 1370 * Indicates initValue was called from parent already, and should be called on children from now on. 1371 * @type boolean 1372 */ 992 1373 AbstractContainerControl.prototype.childInitValue = false; 993 1374 994 /** Holds the configuration parameters for finding/creation control bound HTML elements per relation */ 1375 /** 1376 * Holds the configuration parameters for finding/creation control bound HTML elements per relation 1377 * @type object 1378 */ 995 1379 AbstractContainerControl.prototype.elements = {}; 996 1380 $.extend(AbstractContainerControl.prototype.elements, Control.prototype.elements); … … 1004 1388 }); 1005 1389 1390 /** 1391 * Gets the values from all children 1392 * @param {String} getMethodName Getter method name <ul><li>getUserValue</li><li>getWireValue</li></ul> 1393 * @return an array containing the values found in the this controls child controls 1394 * @type Array 1395 * @private 1396 */ 1006 1397 AbstractContainerControl.prototype.getValueLoop = function( getMethodName) { 1007 1398 … … 1009 1400 1010 1401 var children = this.getChildren(); 1011 1402 1012 1403 // loop trough all contained elements ('rows or members'), and get their value 1013 1404 for ( var i in children) { … … 1018 1409 } 1019 1410 1411 /** 1412 * Sets the values for all of this controls children 1413 * @param {String} setMethodName The setters method name <ul><li>setUserValue</li><li>setWireValue</li></ul> 1414 * @param {Array} value The values should be ordered in the same order as the children 1415 * @private 1416 */ 1020 1417 AbstractContainerControl.prototype.setValueLoop = function( setMethodName, value) { 1021 1418 1022 1419 // ignore childUpdates 1023 1420 var restore = this.updateValue; 1024 this.updateValue = function( ){};1421 this.updateValue = function( childControl ){}; 1025 1422 1026 1423 // loop trough all contained elements ('rows or members'), and set their value … … 1037 1434 } 1038 1435 1436 /** 1437 * Gets the values of all child controls in user format 1438 * @return an array of values found in the child controls. These values are in user format 1439 * @type Array 1440 */ 1039 1441 AbstractContainerControl.prototype.getUserValue = function() { 1040 1442 1041 1443 return this.getValueLoop("getUserValue"); 1042 1444 } 1043 1445 1446 /** 1447 * Sets the values for all of this controls children. The value is expected to be in user format 1448 * @param {Array} value The values should be ordered in the same order as the children 1449 */ 1044 1450 AbstractContainerControl.prototype.setUserValue = function( value) { 1045 1451 … … 1047 1453 } 1048 1454 1455 /** 1456 * Gets the values from all children 1457 * @return an array containing the values found in the this controls child controls 1458 * @type Array 1459 * @private 1460 */ 1049 1461 AbstractContainerControl.prototype.getValue = function() { 1050 1462 … … 1052 1464 } 1053 1465 1466 /** 1467 * Sets the values for all of this controls children 1468 * @param {Array} value The values should be ordered in the same order as the children 1469 * @private 1470 */ 1054 1471 AbstractContainerControl.prototype.setValue = function( value) { 1055 1472 … … 1058 1475 } 1059 1476 1477 /** 1478 * Gets the values from all children. 1479 * @return an array containing the values found in the this controls child controls. The values returned will be in wire format 1480 * @type Array 1481 */ 1060 1482 AbstractContainerControl.prototype.getWireValue = function() { 1061 1483 1062 1484 return this.getValueLoop("getWireValue"); 1063 1485 } 1064 1486 /** 1487 * Sets the values for all of this controls children. The value is expected to be in wire format 1488 * @param {Array} value The values should be ordered in the same order as the children 1489 */ 1065 1490 AbstractContainerControl.prototype.setWireValue = function( value) { 1066 1491 … … 1068 1493 } 1069 1494 1495 /** 1496 * Sets the original value of the control (This doesn't do anything) 1497 * @param {Object} value 1498 */ 1070 1499 AbstractContainerControl.prototype.setOriginalValue = function( value) { 1071 1500 1072 1501 } 1073 1502 1503 /** 1504 * Checks if there are any changes in the child controls 1505 * @return 1506 * @type boolean 1507 */ 1074 1508 AbstractContainerControl.prototype.hasChanges = function() { 1075 1509 … … 1082 1516 } 1083 1517 1518 /** 1519 * Always returns false 1520 * @param {object} thatValue 1521 */ 1084 1522 AbstractContainerControl.prototype.valueEquals = function( thatValue) { 1085 1523 … … 1088 1526 1089 1527 1528 /** 1529 * Doesn't do anything 1530 */ 1090 1531 AbstractContainerControl.prototype.clearChildValues = function() { 1091 1532 1092 1533 }; 1093 1534 1535 /** 1536 * Gets all child controls 1537 * @return object containing all the children 1538 * @type Object 1539 */ 1094 1540 AbstractContainerControl.prototype.getChildren = function() { 1095 1541 … … 1097 1543 } 1098 1544 1545 /** 1546 * Gets a child by it's ID 1547 * @param {String} id 1548 * @return the child 1549 * @type Control 1550 */ 1099 1551 AbstractContainerControl.prototype.getChild = function( id) { 1100 1552 … … 1102 1554 } 1103 1555 1556 /** 1557 * Initializes typical container elements 1558 * @param {Boolean} create If true it will create the container elements if the don't already exist 1559 * @private 1560 */ 1104 1561 AbstractContainerControl.prototype.initContainerElements = function( create) { 1105 1562 … … 1109 1566 } 1110 1567 var layout = ControlElements.lookup(this, ControlElements.REV_LAYOUT, create); 1111 if (layout) { 1568 if (layout) { 1112 1569 layout.hide(); 1113 1570 } … … 1119 1576 1120 1577 /** 1578 * the item selector 1121 1579 * @final 1122 1580 */ … … 1126 1584 * Creates the HTML elements for hosting a new child-id by cloning the "layout" section into the "container" section This will 1127 1585 * also register the newly created elements into the 1128 * 1586 * @param {String} id Id to be used to the newly created child 1587 * @return the new control elements 1588 * @type jQuery 1129 1589 * @final 1130 1590 */ … … 1151 1611 } 1152 1612 1613 /** 1614 * Creates a new control based on type but doesn't add it to the list of children 1615 * @param {String} id The id of the new child control 1616 * @param {FieldType} type The childs field type 1617 * @return the child control 1618 * @type Control 1619 */ 1153 1620 AbstractContainerControl.prototype.createChildControl = function( id, type) { 1154 1621 … … 1186 1653 return childControl; 1187 1654 } 1188 1655 1656 /** 1657 * Places a the child control in the list of this controls children 1658 * @param {String} id 1659 * @param {Control} childControl 1660 */ 1189 1661 AbstractContainerControl.prototype.putChild = function( id, childControl) { 1190 1662 … … 1192 1664 } 1193 1665 1666 /** 1667 * Runs validation on this control and acknowledges a change in value 1668 * @param {Control} childControl 1669 */ 1194 1670 AbstractContainerControl.prototype.updateValue = function(childControl) { 1195 1671 this.newValidation(this.getValue()); … … 1197 1673 } 1198 1674 1675 /** 1676 * Checks if this control and all it's child controls are valid 1677 * @param {Boolean} forceValidation Does the validation if changes have been made or not 1678 */ 1199 1679 AbstractContainerControl.prototype.isValid = function(forceValidation) { 1200 1680 var valid = this["<super.call>"]("isValid", [forceValidation]); -
trunk/modules/kauri-forms/kauri-forms-framework/src/test/js/testPage.html
r606 r643 30 30 <script type="text/javascript" src="../../main/kauri/js/collection.js" ></script> 31 31 <script type="text/javascript" src="../../main/kauri/js/composite.js" ></script> 32 <script type="text/javascript" src="../../main/kauri/js/case.js" ></script> 32 33 <script type="text/javascript" src="../../main/kauri/js/date.js" ></script> 33 34 <script type="text/javascript" src="../../main/kauri/js/form.js" ></script> … … 58 59 <script type="text/javascript" src="test-composite.js" ></script> 59 60 <script type="text/javascript" src="test-collection.js" ></script> 61 <script type="text/javascript" src="test-case.js" ></script> 60 62 <script type="text/javascript" src="test-form.js" ></script> 61 63 <script type="text/javascript" src="test-date.js" ></script> 64 65 <link rev="stylesheet" src="../../main/kauri/public/css/datepicker.css"/> 62 66 63 67 </head>
Note: See TracChangeset
for help on using the changeset viewer.