A Legacy Notes Developer's journey into madness.

Domino 8.5.3: Problem and solution to ’formId’ is null or not an object or TypeError: ’undefined’ is not an object

Devin Olson  January 19 2013 07:32:23 AM
I've been working on a new project for a little while now.  It was working perfectly my development environment (Domino 9 Beta server), and the time had come to put a limited access version into production for additional testing.  Production is running 8.5.3

Yes, I can hear the rumblings now.  But please understand that there is NO WAY we are going to run a Beta  release in a production environment, but we will likely be a first adopter once the release goes gold.  

Anyway, we set up the test application on the production server, configured the ACL, and started playing with it.  At which point it promptly broke.   When certain buttons (not all of them) were clicked, a dialog box would pop up giving an error -the error varied depending on what browser was being used (Safari, FF, Opera, MSIE), but the error was usually some variation of:

Error: 'formId' is null or not an object

- or -

TypeError: 'undefined' is not an object (evaluating '_cl.formId')

This issue wasn't happening on ALL object clicks, only those which were calling XSP:partialRefreshGet() or XSP:partialRefreshPost().

It turns out that In Domino 8.5.3 there is an known issue in the implementation of XSP:partialRefreshGet() and XSP:partialRefreshPost().

The second argument to both of these methods is the "options" parameter. This parameter is SUPPOSED to be OPTIONAL, but the issue in 8.5.3 can cause, if the second argument is not present, a failure to properly determine the client side identity of the element ID specified in the first argument.  Which results in the nasty dialog warning on the browser.  The target ID for the partial refresh being passed through the AJAX call back to the browser doesn't exist -hence the dialog error.  

This issue never showed up in development or testing because I added the calls to XSP.partialRefreshGet() to the development version AFTER having upgraded the development server to 9 beta.  The good news is this issue is obviously resolved in version 9.   The bad news is that until I put in a solution we can't roll to production.  

Fortunately, the solution is really, really simple.   Simply add an empty second parameter to the calls.  




XSP.partialRefreshGet("#{id:myWayCoolElementID}", {});

And voilà, the code now works as designed.  



No Comments Found

Discussion for this entry is now closed.