How to localy maintain a historylist of latest events.

0
Got one object on my page for which a user fills one of the attributes, say postalcode. Upon enter data is retrieved from the back end, filling the other attributes. The user clears the postalcode, other attributes are cleared and forgotten and the user enters another postalcode in the same single object and the other attributes are filled again. Works fine. Now the requirement is that we want to see a short historylist of objects (so postalcode and attributes) in the bottom of the screen. Just as a reminder, seeing what happened these last few minutes on this page. How to do that optimally, without any extra calls to the backend, microflow or storage. I am thinking of javascript adding values to a dom-element. Any thoughts?
asked
1 answers
1

Done.  Did this with javascript that copied values to a history table which is 5 rows of attributes 1, 2 and 3:

var i;
for (i = 5; i >= 1; i--) {
    var j = i - 1;
    document.getElementsByClassName('attr1obj' + i)[0].innerHTML = document.getElementsByClassName('attr1obj' + j)[0].innerHTML;
    document.getElementsByClassName('attr2obj' + i)[0].innerHTML = document.getElementsByClassName('attr2obj' + j)[0].innerHTML;
    document.getElementsByClassName('attr3obj' + i)[0].innerHTML = document.getElementsByClassName('attr3obj' + j)[0].innerHTML;
    }
document.getElementsByClassName('attr1obj0')[0].innerHTML = sessionAttr1;
document.getElementsByClassName('attr2obj0')[0].innerHTML = sessionAttr2;
document.getElementsByClassName('attr3obj0')[0].innerHTML = sessionAttr3;

And added some styling to prettify it. Works fine. Can’t think of a more lean way to do this.

answered