Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Scout » Cannot find the source of Javascript error(How do i debug javascript error in Java Scout Eclipse)
Cannot find the source of Javascript error [message #1857694] Tue, 21 February 2023 16:28 Go to next message
Niyam Poudel is currently offline Niyam PoudelFriend
Messages: 1
Registered: February 2023
Junior Member
Hello. I am working with Java Eclipse Scout and I am new to it. I came across a Javascript error and I am now sure how to properly start debugging this scenario. Please kindly provide some direction. Do I have to modify some js files? Where do I find them? The error is presented below. I have modified some lines (the ports for localhost) for security purposes.

2023-02-21T17:09:43,793 ERROR [http-nio-8092-exec-8] org.eclipse.scout.rt.ui.html.json.JsonMessageRequestHandler : JavaScript exception occured while processing event requestFocusInCell for adapter Table[id=1671, modelClass=com.hes.fl.ts.ti.clint.tmsh002.forms.AbstractSavedSearchesDgForm$MainBox$SplitBox$SplitBBox$Tab1Box$SavedSearchColumnsBoxContainer$SavedSearchColumnsBox$SsnTableField$Table, parentId=170]
Uncaught TypeError: Cannot read properties of null (reading 'is') at http://localhost:892/rcs/es/com.rheus.fl.ms-ll.js:37:3
TypeError: Cannot read properties of null (reading 'is')
    at Object.valOrText (http://localhost:892/rcs/es/com.heus.fl.ms-ll.js:37:3)
    at scout.SmartField._readDisplayText (http://localhost:892/rcs/es/com.heus.fl.ms-ll.js:37:3)
    at scout.SmartField._readSearchText (http://localhost:892/rcs/es/com.heus.fl.ms-ll.js:37:3)
    at scout.SmartField._acceptProposal (http://localhost:892/rcs/es/com.heus.fl.ms-ll.js:37:3)
    at scout.SmartField.acceptInput http://localhost:892/rcs/es/com.heus.fl.ms-ll.js:37:3)
    at scout.CellEditorPopup.completeEdit (http://localhost:892/rcs/es/com.heus.fl.ms-ll.js:37:31)
    at scout.Table.focusCell (http://localhost:8092/rocs/res/com.nus.fl.tms-all.js:83:3)
    at scout.TableAdapter._onRequestFocusInCell (http://localhost:892/rcs/es/com.heus.fl.ms-ll.js:37:3)
    at scout.TableAdapter.onModelAction (http://localhost:892/rcs/es/com.heus.fl.ms-ll.js:37:3)
    at scout.ModelAdapter.onModelEvent (http://localhost:892/rcs/es/com.heus.fl.ms-ll.js:37:3)
Re: Cannot find the source of Javascript error [message #1857721 is a reply to message #1857694] Wed, 22 February 2023 19:37 Go to previous message
Beat Schwarzentrub is currently offline Beat SchwarzentrubFriend
Messages: 207
Registered: November 2010
Senior Member
If you only use the model part of Scout (i.e. no custom widgets or overwritten framework code), this kind of error should not happen. In fact, this is exactly why you would use an abstract application framework in the first place. ;-)

Analyzing the stack trace (from bottom to top):


  • The UI in the browser received a "requestFocusInCell" event for a table.
  • It passed the event to the table widget, which used focusCell() to process the event.
  • Somehow, this caused a CellEditorPopup to run its completeEdit() method.
  • The cell editor popup apparently contained a SmartField, which tried to "accept" the current input.
  • While reading the field value from the DOM, the exception ocurred. The DOM reference in the $field variable apparently was null.


Usually, JavaScript exceptions can easily be analyzed using the browser's developer tools (F12). Unfortunately, I don't think that this would be very helpful in this case, as there is lof of asynchronous stuff going on. The SmartField widgets was probably already destroyed when the focus event was processed.

There are three possible scenarios:


  1. It is a bug in Scout and you are the first person to have found it.
  2. It is a bug in Scout and it's already known and hopefully fixed in a newer version.
  3. Something in your custom application code has caused the issue. Check if you have added JavaScript code (e.g. a custom widget) that could interfere with Scout. On the Server side, such problems can occur when the Scout model is changed outside of the ModelThread.


What Scout version are you using? What did you do to cause this error? Can you reproduce it? If yes, try to reduce the problem, i.e. remove code one by one until you find out exactly which combination is causing the error.

Regards,
Beat
Previous Topic:FileChooser and Accepted File Extensions
Next Topic:BuilderParts createConstraints() use input value for search query
Goto Forum:
  


Current Time: Wed May 08 03:53:39 GMT 2024

Powered by FUDForum. Page generated in 0.03182 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top