From: Mike G. v. a. <we...@ma...> - 2008-03-26 02:56:12
|
Log Message: ----------- Added more debugging code Modified Files: -------------- pg/lib: Applet.pm Revision Data ------------- Index: Applet.pm =================================================================== RCS file: /webwork/cvs/system/pg/lib/Applet.pm,v retrieving revision 1.7 retrieving revision 1.8 diff -Llib/Applet.pm -Llib/Applet.pm -u -r1.7 -r1.8 --- lib/Applet.pm +++ lib/Applet.pm @@ -195,7 +195,7 @@ base64_state => '', base64_config => '', getStateAlias => 'getXML', - setStateAlias => 'setState', + setStateAlias => 'setXML', configAlias => 'config', initializeActionAlias => 'setXML', submitActionAlias => 'getXML', @@ -422,13 +422,14 @@ //STATE // // state can vary as the applet is manipulated. - applet_setState_list["$appletName"] = function(state) { + applet_setState_list["$appletName"] = function(state) { + if (debug) { alert("set state for $appletName to " + state);} state = state || getQE("$appletName"+"_state").value - if (state.match("\S") ) { // if state is not all white space + if (state.match(/<xml/i) || state.match(/<?xml/i) ) { // if state is not all white space if ( base64Q(state) ) { state=Base64.decode(state); } - if (debug) { alert("set state for $appletName to " + state);} + alert("set (decoded) state for $appletName to " + state); try { if (debug || !( typeof(getApplet("$appletName").$setState) =="undefined" ) ) { getApplet("$appletName").$setState( state ); @@ -436,6 +437,8 @@ } catch(e) { alert("Error in setting state of $appletName using command $setState : " + e ); } + } else if (debug) { + alert("new state was empty string or did not begin with <xml-- state was not reset"); } }; applet_getState_list["$appletName"] = function () { |