has been engaged in the development of C/S , about b/S used to some of the technology is unfamiliar, and now in the gradual learning, hope that through timely summary to strengthen understanding and memory. The systems currently being developed are mainly JQuery,Stuts2, andSpring.
On the realization of the free flow backend and Jbpm I will introduce you to another blog post, which only introduces me to using HTML and JQuery on the front end. And the knowledge points that are not often used for me.
1. about Map and jsonobject
Use the Map data structure on the backend to list the work task node name with the approver (excluding the case of a sign-off), that is, the node name is key, the approver is value, as follows:
for (processtaskentity task:processtasklist) {map.put (Task.getactivityname (), Task.getcreateusercode ());} Taskvo.setactivityusermap (map);
a This property is map type, which I want to traverse to the front end. map type of data, respectively, taken to its key and value . map type in front of its , using foreach to traverse the same time as a generic string, The first is {, the second is a , and so on. This is not in line with our use of map type of intent.
so we used a The above code does not need to make any changes to get a Jsonobject a ctivityusermap
var activityusermap = ${taskvo.activityusermap};$.each (Activityusermap, function (key, value) {var temp= "<option Value= ' + key + ' > ' + key + ' </option> '; $ (' Select[name= ' activitynamechoose "] '). Append (temp);});
This code, if it is pure Java , is simple and clear. But with Js to write, there are many twists and turns:
1. controls obtained with JQuery are no longer available . Options.add () and other methods;
2.$ (' select[name= ' Activitynamechoose "]) cannot be added after [0];
3. The contents of Temp if written in append will be reported undefined is not a function, the reason is unknown.
2. issue with Select selected Value
The correct value method after the test is
$ ("Select[name= ' Activitynamechoose ')". Val ()
and the incorrect method of taking the value
$ ("Input[name= ' UIDSCB ']:checked"). Val () $ ("Input[name= ' UIDSCB ']:checked"). value$ ("Select[name=" Activitynamechoose '] "). Value;
$ ( "Select[name= ' activityname choose '] " " .options also cannot get all options options.
3.$ ("Input[name= ' XXX ']:not (: Checked)"): Method of obtaining a Select unchecked value
For a detailed approach to using jquery to manipulate Select , see: Summary ofjquery Select operation control Methods . Also on the traversal of jquery, see $.each traversal map, array. In addition, in the process of solving the above problems, we also refer to the three kinds of three implementations of jquery.
This article is from the "South Lake Miner Technology Space" blog, please be sure to keep this source http://jncumter.blog.51cto.com/812546/1621945
Summary of some problems in the development process of free flow function