Elements go missing

  • Hello All,

    I've run into an odd issue. It has nothing to do with my code. Sometimes, FF just sets an entire DIV to "HIDDEN". This occurs in IE also, but a simple clean cache resolves the issue.

    My concern is once I go into production, this may occur randomly. Is there a way to troubleshoot this can of behaviour? Has this something to do with my rendering? Or has this something to do with my webserver?

    Thanks for any input.

    Jack


  • There is no such thing as random. Seriously. Producing random behaviour is extremely difficult for software. So the likelihood is that there's a bug in your code.

    You could add logging statements to Ext functions which your code might be calling in error.

    Like Element.hide, Element.setVisible, Component.hide, Component.setVisible

    Then examine the log. You could even log stack traces by throwing and catching an error, and capturing its stack so that you can sift through it and trace back to the line of code with the mistake in it.

    Well that's what I'd do. Report back on your line of attack and your progress.


  • No they don't, but form fields shouldn't be stateful.

    The only components that can hold state are:
    - items in layout:'border' (height/width/collapsed)
    - Ext.Window (top/left/height/width)
    - Ext.GridPanel (column order/width/hidden)


  • I've never had that happen to me.

    If it seems to be happening at "random" it might be related to an ajax callback returning, or something else you may have running on a timer.


  • If it is 'almost' random it could be caused by the state manager.

    Does your code contain the following line:
    Ext.state.Manager.setProvider(new Ext.state.CookieProvider());

    In that case you should put this on top of your code:
    Ext.Component.prototype.stateful = false;
    and add stateful:true and stateId:'' (or id:'') to the config of all components that you actually want to keep state for.


  • Hello Animal,

    I'm not much of a programmer, so could you point me in the right direction for doing as you said:

    "You could add logging statements to Ext functions which your code might be calling in error"

    Thanks

    Jack


  • Hello Condor,

    Thank you for the detailed explanation. Just a short question regarding :

    "add stateful:true and stateId:'' (or id:'') to the config of all components"

    Is stateful inheritable. Meaning, inside a window component, I have textboxes, combos etc, do they automatically inherit the statufl, or does stateful really need to be for every component, like you said, "want to keep state"

    Thanks

    Jack







  • #If you have any other info about this subject , Please add it free.#
    Your name:
    E-mail:
    Telphone:

    Your comments:


    If you have any other info about Elements go missing , Please add it free.

    7 January 2009 | cameltoepants.com | edit