I'm not sure quite what "Container Reset" does.
It has 2 modes "Reset" and "Clear" but both appear to do the same. Are they meant to do something different or are they doing something behind the scenes?
If I do a container reset on a layout group it clears the values BUT if another form control has its visibility based on a reset value then it is not being hidden. Is there a way of doing this or should it be doing this already?
Thanks
It has 2 modes "Reset" and "Clear" but both appear to do the same. Are they meant to do something different or are they doing something behind the scenes?
If I do a container reset on a layout group it clears the values BUT if another form control has its visibility based on a reset value then it is not being hidden. Is there a way of doing this or should it be doing this already?
Thanks
RE: Container Reset
There is a difference between the two modes. 'Clear' should remove all the values, where as 'Reset' should put them back to what they were initially. For example, assume there is a text box on a page which was originally displayed with a value of 'a', but was subsequently changed by the user to 'b'. A Clear operation would remove the value completely (the text box would be blank), where as a 'Reset' would set the value back to 'a'.
With regards to your second point, it is currently the case that any groups whose visibility is dependant on a field which has been reset will not be correctly updated. You will need to adjust the visibility yourself after using the Container Reset action. This is something we will look at for a future release.
For now, I think you should be able to automate this process by connecting a new function to the reset process to handle the needed visibility changes.
You can try adding the following script fragment to a script file for your page, and see how it works for you.
I have not extensively tested this though, and it is likely to need fine tuning for all the different scenarios, so please let me know how you get on.
dojo.connect(hyf.util, 'resetContainer', function(container) { dojo.query('input[type=text],input[type=checkbox], select, textarea', container).forEach(function(item){ if (typeof(item.onchange) == 'function') item.onchange(); if (typeof(item.onclick) == 'function') item.onclick(); }); //radio buttons need special handling, as the method should only be called with the selected button var radiosToCheckLater = {}; dojo.query('input[type=radio]', container).forEach(function(item){ if (typeof(item.onchange) == 'function') item.onchange(); if (typeof(item.onclick) == 'function') { if (item.checked) { item.onclick(); radiosToCheckLater[item.name] = 'false'; } else { if (typeof(radiosToCheckLater[item.name]) == 'undefined') radiosToCheckLater[item.name] = 'true'; } } }); //now handle any radios that are not selected at all for (name in radiosToCheckLater) { if (radiosToCheckLater[name] == 'true') try { eval(name + 'ValueChanged(document)'); } catch (e) {} } });
Regards,
Gerard
RE: Container Reset
I think this initial query was with regards to WM3.xx but we seem to be having the issue with WM5. Should this be the case?
Thanks
Hawk
RE: Container Reset
I have just looked into this, and unfortunately I don+?+?+?t think this area has changed in the newer versions
This means that you will still need the additional script to get the behaviour you were after.
Sorry about this. I have added some additional notes to try and get this change pushed up the priority list.
Regards,
Gerard