views:

207

answers:

5

I have made few changes on this huge JSF page, which is full of Javascript as well. I dont know which change make the problem happen.

The problem is: after some Javascript is executed, all the text fields in the page become readonly. The problem is not occurring in IE7 nor in Firefox. I have debugged all the javascript, there is no errors thrown! And there is nothing telling the fields to become readonly, since its working correctly in IE7.

Not sure what the problem is, could be CSS related? or Javascript? And why is it happening on IE6 only?

Note: "Don't support IE6 is not an option"

A: 

um... don't support IE6??? ;)

Suggest disabling your CSS and seeing if the problem goes away. I'm not aware of any CSS tags that can disable a field, though.

Other than that, debugging is your only option. Remove all your .js and add it back in line-by-line until something breaks.

It will probably be hard for us to help you without seeing some code.

Brad
Are your fields enabled by default (in the html) or disabled? If you are manually enabling the fields using script, that should give you a very good place to begin your search. Finding and disabling every control on the page isn't exactly something that just happens--especially by accident.
Brad
the page is really very large and very complicated, half the fields start disabled and the other enabled. But everything could change with the many Ajax hits in the page.
medopal
+1  A: 

While IE may be buggy make trouble in some situations, I'm quite sure this is not an IE bug.

How do you tell the fields are read only? Do you get any optical confirmation or is it just that you can't click them any more? In that case, I'll bet you a beer that is's some invisible DIV or other layout element that, due to some CSS setting, squeezes itself above the input fields.

Try the IE developer toolbar to find out whether it's a layout problem.

If they are really disabled as in <input disabled> you need to show some JavaScript or (better) a link.

Pekka
Do you have any explanation why its working beautifully on IE7 and FF? Will check the invisible div, but i cant share the code, sorry its an Intranet application.
medopal
Is the input disabled (= greyed out) or unclickable?
Pekka
A: 

See if the HTML for the page has the 'disabled' attribute set on those INPUT elements. If so, then javascript is being used to enable the elements after the page has loaded. This is a not-uncommon technique to keep users from prematurely trying to interact with a page before all scripts have loaded.

If that's what is happening, then what you've probably done is break the way the script recognizes which elements need to be enabled. Since this is only happening on IE6, it sounds like the script might be doing some esoteric DOM navigation, which broke as a result of changes to the markup or CSS.

Unfortunately this is something you'll have to debug by reverting back to previous versions until you identify the change you made that broke the page.

broofa
A: 

Based on the other answers here, and some of your comments to them, it seems there is a JavaScript function in your page that sets elements to be enabled or disabled.

In order to help, we would have to see your code. Here is something you can do yourself, though, that would solve your problem:

  1. Find that function (or ANY function) that sets elements in your page to disabled or enabled.
  2. Depending on your development environment, there are different ways to do this, but somehow add a breakpoint there at the function.
  3. Load the page.
  4. Whenever that function is called, code execution will stop at that function. Whenever it stops, make sure that it was supposed to be called (and watch the call stack).

Eventually, you'll hit that breakpoint at a point where you weren't supposed to. Look at the call stack to see what caused it (which function resulted in a call to this function).

Gabriel McAdams
I know how to debug in Java, but do you have any Eclipse plugins to debug Javascript?
medopal
Sorry. I'm a .net developer, so my eclipse knowledge is low. A simple google search turned these up:http://www.myeclipseide.com/module-htmlpages-display-pid-57.html and http://www.eclipseplugincentral.com/Web_Links-index-req-viewlink-cid-1372.html
Gabriel McAdams
A: 

Still not sure what happened with that build, but what i was sure about is all the Ajax modifications i did was responsible for the problem.

The scenario was like:

  1. Fill textfield1 (hit getValues1 , then hit a validate Ajax)
  2. Fill textfield2 (hit getValues2 , then hit validate on both values together)
  3. Fill textfield3 (hit getValues3 , then hit validate on all three values)

And a forth time again the same scenario. The page was built by a new to JSF guy, and it was very huge. I took long time refactoring it. But now its much better, each text field still have a getValues Ajax, but instead of validating them after getting all the values, i filter the allowed values on the server by sending the chosen criteria

The scenario now:

  1. Fill textfield1 (hit getValues1 Ajax)
  2. Fill textfield2 (hit getValues2 Ajax with value of 1, and get only allowed values)
  3. ... etc

The problem seems to be an Ajax racing conditions and at some moment IE6 was hanging or stuck in a deadlock, im not sure.

Lesson learned, "Refactoring once may take a week, but without every single issue will take longer"

medopal