After further evaluation, we can see the issue. The root cause is that when calling onCellUpdated, there is ajaxcall back still going on, so, we need to wait a little a bit to get the ajaxcall finished its processing. We can call the delcomment as it also needs ajaxcall inside so as a workaround, please try to add the line of code(s):
e.g Sample code:
i.e., just put off the delcomment action a little later.
If you still find the issue, could you provide us a sample .jsp page (runnable) containing your code (server side and client side, etc.) with template file (if any), we will check it and may log an appropriate ticket accordingly.
However, I can’t wait a few seconds, this operation must be done very quickly. Else, it will cause some issue on my application.
In fact, the onCellUpdated function is here to display some error that could append during OnCellModifiedOnAjax. In server side, we have the following code which writes a comment :
protected void GridWeb1_CellModifiedOnAjax(object sender, CellEventArgs e)
{
var errorMessage = ComputeErrorMessageIfCellValueIsNotCorrect(e.Cell);
if (!string.IsNullOrEmpty(errorMessage) || errorMessage != "")
{
GridWorksheet sheet = GridWeb1.WorkSheets[worksheetState.ReportWorksheet.Name];
int i = sheet.Comments.Add(e.Cell.Name);
GridComment comment = sheet.Comments[i];
comment.Note = errorMessage;
}}
And then, on client side we have :
function onCellUpdated(cell) {
var errorMessage = cell.getAttribute('CMNT_NOTE');
if (errorMessage != null) {
ShowModalError("error", errorMessage);
var gw = gridwebinstance.get("<%=GridWeb1.ClientID%>");
debugger;
var col = gw.getCellColumn(cell);
var row = gw.getCellRow(cell);
gw.delcomment(row, col)
}}
If we postpone the delcomment function, the user may get many times the same error message if he modifies the cell many times quickly because the comment is not deleted.
Thanks for providing us further details and sample code segments.
We need to evaluate your issue if we could provide some other way around to cope with it or may log a ticket for investigation and for a fix/enhancement.
I take this opportunity to ask you another question. As GridWeb1_CellModifiedOnAjax handler is used in my application to validate the value, I need a feature which allow me to restore cell value to its previous value (value before entry) if there is an error.
As an exemple let’s take a workbook with only one cell A1 which contains the value “50”. If user type “100” inside, then as it’s not a correct value, i would like to go back to “50” value.
Could you tell me if there is a way to restore the cell value to the previous value
from the CellModifiedOnAjax handler or onCellUpdated client function ?
For your requirements, we think you need to delete local comment only, so you may update your script a bit. We have added delcommentlocal function, kindly try to use this function instead:
e.g Sample code:
We suggest you should use the validation feature. You may implement business logic on CellModifiedOnAjax in onCellUpdated event which occurred on client side, the value is already changed. The process can be:
you edit value in client, then it will notify the server about the updated value, then CellModifiedOnAjax occurred, then on client side get ajaxcallback in onCellUpdated.
Since I updated Aspose to v18.1, I have big trouble on worksheet change. In fact, if a workbook contains more than one worksheet, when you are clicking on any worksheet button, the GridWeb loads the new worksheet but it becomes oversized and loose every user interaction (cell selection, edit,…).
I attach to this post a workbook that will allow you to reproduce the issue.
I did test your scenario/ case a bit by importing your attached XLSM file and noticed the issue as you mentioned. But I found your XLSM file is corrupt and MS Excel displays errors regarding drawing objects and have to recover it finally. I am afraid, generally if a file is corrupt, Aspose.Cells.GridWeb might not parse/recover it fine, so you are getting this issue when navigating to other worksheets or so. Do you also find this issue with older versions as well or in older versions it was working fine?
We evaluated your issue further and found that your issue is general and it should be fixed. We are able to reproduce the issue already, we found that worksheet becomes over sized and unresponsive when navigating to or clicking on it in Aspose.Cells.GridWeb. I have logged a ticket with an id “CELLSNET-45902” for your issue. We will look into it soon.
Once we have an update on it, we will let you know here.
This is to inform you that we have fixed your issue (logged earlier as “CELLSNET-45902”) now. We will soon provide you the fix after performing QA and incorporating other enhancements and fixes. We hope we can provide you the fix in the next 3-5 days or so.
I tested your scenario/ case using your template file “0 Web - W010 - Liasse Locale 99-02_0.xlsm” you previously attached with Aspose.Cells.GridWeb v18.2 with its resource files, it works fine. I navigated to different sheets and moving from one cell to other, add or change cell values, etc. I do not see any tag is added with the cell value. Do you use some other file? If that is the case, kindly do share the file. If you are using the same file, kindly do provide a sample project (runnable) to reproduce the issue on our end, we will check it soon.
Please try to type a SPACE in any cell and you will see that will appear in the concerned cell.
I think that the <br> issue is a similar problem. You may reproduce it on IE11 but please, pay attention to not use any meta tag to emulate previous version of IE (i.e. your page must not contains <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE9" />).
It seems that the GridWeb displays html code which should not be displayed to end user.
Could you please investigate a bit more deeper in order to find where this general problem come from?
I am able to observe the issue as you mentioned by importing your template file “0 Web - W010 - Liasse Locale 99-02_0.xlsm” into GridWeb. By typing a SPACE character in a cell, Aspose.Cells.GridWeb will embed " " in the concerned cell. I have logged a ticket with an id “CELLSNET-45913” for your issue. We will look into it soon.
Once we have an update on it, we will let you know here.