diff --git a/etemplate/js/et2_widget_button.js b/etemplate/js/et2_widget_button.js index 4d8c5f97fd..96f0facb3e 100644 --- a/etemplate/js/et2_widget_button.js +++ b/etemplate/js/et2_widget_button.js @@ -91,8 +91,22 @@ var et2_button = et2_baseWidget.extend([et2_IInput, et2_IDetachedDOM], { // Execute the JS code connected to the event handler if (this.options.onclick) { - if (!this.options.onclick()) + // onclick needs to get current values + if(typeof this.options.onclick == "string") { + // Don't change this.options.onclick so we can do this again + var onclick = et2_js_pseudo_funcs(this.options.onclick, this.id); + if(onclick.indexOf("$") >= 0 || onclick.indexOf("@") >= 0) { + var mgr = this.getArrayMgr("content"); + if(mgr) onclick = mgr.expandName(onclick); + } + onclick = new Function(onclick); + if(!onclick()) + return false; + } + else if (!this.options.onclick()) + { return false; + } } // Submit the form diff --git a/etemplate/js/et2_widget_link.js b/etemplate/js/et2_widget_link.js index 7c7e323499..18810921b1 100644 --- a/etemplate/js/et2_widget_link.js +++ b/etemplate/js/et2_widget_link.js @@ -861,8 +861,8 @@ var et2_link_list = et2_link_string.extend({ $j(document.createElement("td")) .appendTo(row) .addClass(columns[i]) - .text(_link_data[columns[i]]) - .click( function(){egw.open(_link_data.id, _link_data.app, "edit", _link_data.extra);}); + .click( function(){egw.open(_link_data.id, _link_data.app, "edit", _link_data.extra);}) + .text(_link_data[columns[i]]); } // Date