1 function oilsRptBuilderWidget(node) {
5 oilsRptBuilderWidget.prototype.init = function(node) {
10 this.selector = $n(this.node, 'selector');
11 // this.widgetNode = $n(this.node, 'widget_td');
13 this.selector.onchange = function() {
15 obj.selector.options[obj.selector.selectedIndex]);
22 oilsRptBuilderWidget.prototype.hideWidgets = function(node) {
23 if(!node) node = this.widgetNode;
24 if( node.nodeType != 1 ) return;
25 if( node.getAttribute('widget') ) {
28 var cs = node.childNodes;
29 for( var i = 0; cs && i < cs.length; i++ )
30 this.hideWidgets(cs[i]);
35 oilsRptBuilderWidget.prototype.showWidgets = function(opt) {
36 _debug("showing widget with opt value: "+opt.value);
38 var widget = opt.getAttribute('widget');
39 if( widget ) unHideMe($n(this.node, widget));
43 oilsRptBuilderWidget.prototype.getCurrentOpt = function() {
44 return this.selector.options[this.selector.selectedIndex];
50 /* ------------------------------------------------------------------------- */
51 oilsRptTFormManager.prototype = new oilsRptBuilderWidget();
52 oilsRptTFormManager.prototype.constructor = oilsRptTFormManager;
53 oilsRptTFormManager.baseClass = oilsRptBuilderWidget.prototype.constructor;
54 function oilsRptTFormManager(node) { this.init(node); }
56 /* displays the appropriate transforms for the given types and flags */
57 oilsRptTFormManager.prototype.build = function( dtype, show_agg, show_noagg ) {
58 for( var i = 0; i < this.selector.options.length; i++ ) {
59 var opt = this.selector.options[i];
60 var t = opt.getAttribute('datatype');
61 if( t && t != dtype ){
64 var ag = opt.getAttribute('aggregate');
67 else if( ag && ! show_agg )
69 else if( !ag && show_noagg )
76 oilsRptTFormManager.prototype.getCurrentTForm = function() {
77 var opt = this.getCurrentOpt();
80 datatype : opt.getAttribute('datatype'),
81 aggregate : opt.getAttribute('aggregate'),
83 //data.params = this.getWidgetParams(data);
89 oilsRptTFormManager.prototype.getWidgetParams = function(obj) {
90 switch(obj.datatype) {
95 $n(this.widgetNode, 'string_substring_offset').value,
96 $n(this.widgetNode, 'string_substring_length').value
107 /* ------------------------------------------------------------------------- */
109 oilsRptOpManager.prototype = new oilsRptBuilderWidget();
110 oilsRptOpManager.prototype.constructor = oilsRptOpManager;
111 oilsRptOpManager.baseClass = oilsRptBuilderWidget.prototype.constructor;
112 function oilsRptOpManager(node) { this.init(node); }