
I have to display the "Last Modified" auto save message in a portlet page at the right end corner using JSP I have used this below coding but I'm not getting the solution can anyone help me with the solution?
I have written one function inside the script:
function saveProjectDetails(id){
var rowNo = id.split("-")[1].split("Project")[1];
var colNo = id.split("-")[0].split("txtWeek")[1];
var projcode=dojo.byId("txtProject"+rowNo+"-Code").value;
var weekId = dojo.byId("txtWeek"+colNo).value;
var year = '<c:out value="${allocateResBean.headerBean.year}"/>';
var actualHrs = dojo.byId(id).value;
var userId = '<c:out value="${allocateResBean.userid}"/>';
dojo.xhrGet({
url:"<portletx:resourceURL><portlet:param name='action' value='assignusersdetails' /></portletx:resourceURL>",
content: {userid:userId,wkid:weekId,projectCode:projcode,yr:year,ahrs:actualHrs},
load: function(data){
var element = dojo.byId("savedNotification");
var time = new Date();
element.innerHTML="Last Saved:"+time.toDateString()+" "+time.toLocaleTimeString();
}
});
}
-->In JSP I've called the function in the 'On Change' in the below code
<tr>
<td align="center">
<input type="text" size="3" maxlength="2" name="txtWeek2-Project${rowNo}-Actual" id="txtWeek2-Project${rowNo}-Actual"
value="<c:out value='${project.week2.actualHours}'/>" onKeyPress="return validateCharacter();"
onKeyUp="return calculateTotalHrs(this.id);" onFocus="changeStyle(this.id);" onChange="saveProjectDetails(this.id);"/>
</td>
</tr>
-->And in outside of the table row I've used div function.
<div id="savedNotification" style="float:right">
</div>
-->I'm using the text box named Actual Hours when i change anything in that textbox 'Last Modified' Message should be displayed
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.