[Logo] Enterprise Client Community
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Casabac and Internet Explorer 10: Javascript problems  XML
Forum Index -> Development
Author Message
brandt

Power User
[Avatar]

Joined: 12/03/2008 16:37:34
Messages: 45
Location: Bern
Offline

Hello community,

we hope we are not the only one who still have running applications based on Björns old AJAX framework Casabac.

We have tested our old Casabac application on Internet Explorer 10. Unfortunately, our Casabac application is not running on IE 10. It seems that Javascript variables are not initialized correctly.

Is there somebody struggling with the same problem?

Any help will be appreciated.

Regards
Joachim
moebus

Power User

Joined: 21/11/2007 12:49:18
Messages: 93
Offline

The problem lies in the way that functions in the "central lib" are invoked.

There are various functions like

var mm_processHotKeys = null;
function processHotKeys(bodyEvent)
{
if (mm_processHotKeys == null) mm_processHotKeys = CL().C_processHotKeys;
return mm_processHotKeys(bodyEvent);
}

It looks like javascript logic in what is the meaning of "this" has been defined more precisely, and IE10 is finally following to this standard, so one has to take care of who is invoking a function that was defined in another context.
When you replace the last line with the following:

return mm_processHotKeys.call(this,bodyEvent);

the correct "this" object is specified, and the code works again as intended.
You might be pleased to notice that in addition to IE10 this brings casabac back to other modern browsers like firefox, chrome and safari.

We found quite a lot of such constructs in the files csc.js, PAGEControls.js and TEXTGRIDControls.js. Don't think it appropriate to post our version of the files since it is surely not yours, so you will have to look at your version of the files anyway, a grep for

mm_.* == null\) mm_.* = CL\(\).C_

will probebly find all functions to fix.

Hope this helps with you as well, we did only very limited testing with this fix, don't think one of our customers is already using IE10.
Manfred
brandt

Power User
[Avatar]

Joined: 12/03/2008 16:37:34
Messages: 45
Location: Bern
Offline

Hello Manfred,

thank you so much for your reply.

Your reply is very, very helpful.

Thanks a lot.

Regards
Joachim
mveser

Active

Joined: 19/05/2010 10:54:15
Messages: 9
Offline

Hello Manfred,

I tried this with IE 9 and Casabac did not work any more. You can see the error message in the attachment.

I found your pattern at 41 locations in two files, csc.js and CONTEXTMENUControls.js, both in the HTMLBasedGUI/general folder. I attached the modified files and the difference reports from WinMerge with the differences marked in yellow.

I can only attach 3 files so another entry will follow.

Regards
Marcus
 Filename csc.js [Disk] Download
 Description second modified file
 Filesize 89 Kbytes
 Downloaded:  651 time(s)

 Filename csc.js [Disk] Download
 Description first modified file
 Filesize 89 Kbytes
 Downloaded:  614 time(s)

[Thumb - ErrorMessage.png]
 Filename ErrorMessage.png [Disk] Download
 Description Error message
 Filesize 62 Kbytes
 Downloaded:  602 time(s)

mveser

Active

Joined: 19/05/2010 10:54:15
Messages: 9
Offline

Hello Manfred,

this is the continuation of my entry with the difference reports attached.

Regards
Marcus
 Filename Compare-Reports.zip [Disk] Download
 Description Difference reports with the differences marked in yellow
 Filesize 75 Kbytes
 Downloaded:  661 time(s)

mveser

Active

Joined: 19/05/2010 10:54:15
Messages: 9
Offline

Hello Manfred,

I made a mistake in my recent post by attaching csc.js twice. This is the missing CONTEXTMENUControls.js.

Regards
Marcus
 Filename CONTEXTMENUControls.js [Disk] Download
 Description Modified file
 Filesize 11 Kbytes
 Downloaded:  848 time(s)

moebus

Power User

Joined: 21/11/2007 12:49:18
Messages: 93
Offline

Hi Markus,
the javascript function proposed in my fix is the "call" syntax allowing to specify the "this" object, see e.g. http://yehudakatz.com/2011/08/11/understanding-javascript-function-invocation-and-this/.

looking at your csc.js I see that you forgot to insert the "call" stuff.
e.g. line 436
replace

return mm_openCasabacPageAsModalPopup(this,pPage,pWidth,pHeight);

with

return mm_openCasabacPageAsModalPopup.call(this,pPage,pWidth,pHeight);

Manfred
mveser

Active

Joined: 19/05/2010 10:54:15
Messages: 9
Offline

Hello Manfred,

reading your solution correctly and inserting the "call" stuff, I can see the Casabac windows also in IE 10 as long as they are in the workplace. The remaining problem is that I am not able to open any popups. With IE 9 everything is OK.

Regards
Marcus
mrubenfeld



Joined: 25/10/2013 08:59:20
Messages: 4
Offline

Hello community,

We have been using CIS_V24_20111006 without problem but we wanted to enable our application in Firefox so we took the new v8 build from Software AG last year.

We have Software AG's v8 build, version CIS_V826_20121130_2039_CIT, and we are using apache-tomcat-6.0.36.

We have our application working in IE9 and Firefox using v8.

But then along came IE10.

We're having problems with IE10 crashing adapters with grids in them when using v8.

Our application runs in IE10 in Compatibility Mode but not in straight IE10 Mode.

It looks like the problem is with v8, not our application, because we see the same behavior in the v8 demo workplace.

Try this: Open the demo workplace: localhost:port#/your project/HTMLBasedGUI/workplace/demo.html.

Make sure that your IE10 is in IE10 Mode, not in Compatibility Mode.

Click the Hello World demo or Combo Box demo in the Navigation frame; they work.

Click Control Overview demo, Tree demo, Drag and Drop demo, Text Grids demo, or Schedule demo in the Navigation frame; they all crash.

It can also be seen using the ide workplace: localhost:port#/your project/HTMLBasedGUI/workplace/ide.html

When the workplace opens, the Navigation frame itself crashes.

In all these cases, you can see the properly rendered page for a second just before the content crashes.

We checked the js code as per Manfred's advice and all those changes do appear in v8 already (there were about 6 they missed, we added them, but fixing the missing ones did not fix the problem).

Note: We are not sure if these crashes also happen in the v24 demo workplace when using IE10.

We have attached the log file for the Tree demo click crash, {serverLog_20131025 - Tree Demo IE10.log} to this message.

We have attached our cisconfig.xml file to this message.

Any help would be greatly appreciated.

Thanks in advance.

Marty
 Filename v8 testing IE10 problems.rar [Disk] Download
 Description
 Filesize 29 Kbytes
 Downloaded:  792 time(s)

CaptainCasa

Power User
[Avatar]

Joined: 21/11/2007 12:23:06
Messages: 5519
Offline

...so "crash" means, that your browser comes up with an "error screen", showing the following stack trace?

Björn

Code:
 20131025/115314/993 D CASA11_332673037577...... CIS l.setDataAsXMLInternally(Unknown Source) InteractionAdapter.setDataAsXML: setting property: pagePixelWidth
 20131025/115314/993 D CASA11_332673037577...... CIS l.setDataAsXMLInternally(Unknown Source) InteractionAdapter.setDataAsXML: value is        : 809
 20131025/115314/993 >>>>>>>>>> EXCEPTION OCCURED:  <<<<<<<<<<
 20131025/115314/993 java.lang.IllegalArgumentException
 20131025/115314/993 >>>>>>>>>> Stacktrace        <<<<<<<<<<
 20131025/115314/993 java.lang.IllegalArgumentException
 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 	at java.lang.reflect.Method.invoke(Method.java:597)
 	at com.softwareag.cis.server.InteractionModel.passPropertyValue(Unknown Source)
 	at com.softwareag.cis.server.InteractionModel.setDataAsXMLInternally(Unknown Source)
 	at com.softwareag.cis.server.InteractionModel.setDataAsXML(Unknown Source)
 	at com.softwareag.cis.server.XMLProcessor.processXML(Unknown Source)
 	at com.softwareag.cis.server.XMLProcessor.processXMLAndSerialize(Unknown Source)
 	at com.softwareag.cis.server.Connector.doPost(Unknown Source)
 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
 	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
 	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
 	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
 	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
 	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
 	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
 	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)
 	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
 	at java.lang.Thread.run(Thread.java:662)
 
 20131025/115314/993 >>>>>>>>>> ----------------- <<<<<<<<<<
 
 

Björn Müller, CaptainCasa GmbH
mrubenfeld



Joined: 25/10/2013 08:59:20
Messages: 4
Offline

Hi Björn,

Thank you for looking at this.

Yes you are correct. The error screen appears instead of the page.

Attaching screen shots of the crashes in demo workplace and ide workplace.

Marty
 Filename v8 testing IE10 - crash screen shots.rar [Disk] Download
 Description v8 testing IE10 - demo and ide - screen shots of crashes
 Filesize 49 Kbytes
 Downloaded:  724 time(s)

mrubenfeld



Joined: 25/10/2013 08:59:20
Messages: 4
Offline

Hi,

We got our entire application working in IE9 and ie10 using the new v8 build.

But we have a problem with the cisconfig.xml attribute for:

textgridlineunselection="v23"

This attribute is supposed to prevent a textgrid row from being deselected by multiple clicks on the same row. eg: A row is only allowed to be deselected by clicking on a different row.

In v8, each click on a textgrid row toggles the row instead of leaving it selected.

Does anyone know which js class(s) control this feature and the concept of how this attribute feature works?
mrubenfeld



Joined: 25/10/2013 08:59:20
Messages: 4
Offline

Hi,

We think we solved the poblem with "textgridlineunselection=v23" not working in the new v8 build.

Since we only run in "textgridlineunselection=v23" mode, we do not have to check for its value each time.

So we added the following code, which always assumes that textgridlineunselection is set to v23 mode, to the central.js file :

// added to prevent deselect on same row click - MAR 11-19-2013
var vLastTLSelected = this.getPropertyValue(casacontrol.CASA_lastselectprop);
if( (vLastTLSelected == rowIndex) && (vCurrent == "true" || vCurrent == true)) return;
// end of added


The code was added about 16 lines before the end of that function which is shown abridged here:

function C_selectRowTEXTGRID(casacontrol,rowIndex, ctrlKey, shiftKey, suppressSubmit)

It was added as:

function C_selectRowTEXTGRID(casacontrol,rowIndex, ctrlKey, shiftKey, suppressSubmit)
{
if (shiftKey == true)
{
if (this.isIE() == true)
this.parent.document.selection.empty();
else
this.parent.window.getSelection().removeAllRanges();
}
if (!casacontrol || rowIndex < 0) return;
var vVariable = casacontrol.CASA_displayitemsprop+"["+rowIndex+"]."+casacontrol.CASA_selectprop;
this.setKeyboardFocusTEXTGRID(casacontrol, rowIndex);
if (casacontrol.CASA_selectprop != null && casacontrol.CASA_singleselect == false)
{
if (casacontrol.CASA_rowcount != null &&
casacontrol.CASA_rowcount > 0)
{
......


if (vCurrent != "true" && vCurrent != true)
this.selectItemsTEXTGRID(casacontrol, rowIndex, rowIndex);
}
}
}
if (casacontrol.CASA_selectprop != null &&
casacontrol.CASA_singleselect == true)
{
var vCurrent = this.getPropertyValue(vVariable);
// added to prevent deselect on same row click - MAR 11-19-2013
var vLastTLSelected = this.getPropertyValue(casacontrol.CASA_lastselectprop);
if( (vLastTLSelected == rowIndex) && (vCurrent == "true" || vCurrent == true)) return;
// end of added
this.deselectAllTEXTGRID(casacontrol);
if (vCurrent != "true" && vCurrent != true)
this.selectItemsTEXTGRID(casacontrol, rowIndex, rowIndex);
}
if (casacontrol.CASA_lastselectprop != null)
{
var vTopIndex = 0;
if (casacontrol.CASA_topindexprop != null)
vTopIndex = (-1) * (-1) * this.getPropertyValue(casacontrol.CASA_topindexprop);
this.setPropertyValue(casacontrol.CASA_lastselectprop,(vTopIndex+rowIndex));
}
}

Thanks.

Marty
 
Forum Index -> Development
Go to:   
Powered by JForum 2.1.6 © JForum Team