<input id="fileName" name="filename" class="easyui-textbox lg_width" data-options="tipPosition:'bottom'" type="text" >
title = "${aaa}";
insertLabelText("fileName",title);
function insertLabelText(destobj,labelText) {
let lastIndex = getCursortPosition(destobj);
let oldText = $('#'+destobj).textbox('getValue');
let newText = buildNewText(oldText, labelText, lastIndex);
$('#'+destobj).textbox('setValue',newText);
}
function getCursortPosition(destobj) {
var cursorIndex = "-1";
var obj = $('#'+destobj).next()[0].children[0];
if (document.selection) {
obj.focus ();
var range= document.selection.createRange();
range.moveStart ('character', -obj.value.length);
cursorIndex= range.text.length;
}else if (obj.selectionStart || obj.selectionStart==0) {
cursorIndex= obj.selectionStart;
}
return cursorIndex;
}
function buildNewText(oldText,labelText,lastIndex){
let newText = oldText.substring(0, lastIndex) + labelText;
if(oldText.length!=lastIndex&&oldText.length!=0){
newText += oldText.substring(lastIndex, oldText.length);
}
return newText;
}