Client-side exception in application

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Client-side exception in application

FParsons
I've been getting an error in my application, and I don't know if it's an error of mine or a possible javascript bug. I'm coding to plain xforms in 4.3, and am currently using IE8 (forced to).

First of all, I'd like to attach a zip-file with a pared-done version of the app, but because I'm behind a firewall at work, I can't be sure whether or not the zip file will be stripped out. The zip contains a folder which I'm guessing could just be dropped into the "apps" folder (if the orbeon war is imported into a j2ee web project).

I'm getting this message in a standard xforms error dialog:
Exception in client-side code.
•Message: 'cfg' is null or not an object

What the application is doing - it's for sending letters to hospitals or doctors, so there is a repeat of "TX_SOURCE" items. For each, the letter can be sent by "print" or fax (represented by a select1 control).  I want the database to send a list of possible fax numbers that the user can select. There is a "FAX" element with two children "LIST" and "SELECTED" (which expects a "PHN" element). If a user selects a number from the LIST, the "PHN" element gets copied to SELECTED. (Anything already existing there is first deleted.) If the user selects the item "OTHER" in the dropdown, it takes  an empty "PHN" element from the "ui instance" that the user can fill out.

If the user changes his/her mind and selects "Print" again, the "SELECTED" element is emptied again.

What I've found (and it doesn't happen consistently), is that if I select "other", then a fax number, then change the "Send By" value to "Print", I get the error.  It seems like it has something to do with the combination of emptying an element and the "relevance" in some of the binds (I disabled some of the binds to make it simpler). It doesn't happen every time, and you have to play with the order of selecting a fax (a number or or 'other'), then going back to "send by: print".  You pretty much have to play with various combinations repeatedly, but it does eventually happen - even though the circumstances in which the user may cause the error may be relatively rare, it's definitely there. It doesn't happen on every repeat item all the time. Sometimes it happens right away, sometimes you have to play with all the 'sendby' and 'fax dropdown' repeatedly until it does happen. It seems like the xforms engine is getting put in a bad state somehow.

When it does happen, the clearing of the "SELECTED" element doesn't happen (xforms:delete), and there's the danger of wrong information being submitted.
MyApp.zip
I don't know if anyone has the time to look at this.It's infuriating that it happens unpredictably.  The error does appear in the IE8 javascript console, (I have IE set to display all javascript errors), but it won't go to a spot in the local javascript - so I don't know where it's actually happening. I've been able to reproduce this in a recent build of Chrome, too.

If you are able to get this running and reproduce the problem, I'd be very grateful to any pointers you could give me!
-- Francis