How to set the main page's DOCTYPE declaration in Vaadin
I'm having issues with scroll offset detection that seem to be related with the DOCTYPE declaration:
Using Doctype let scrollTop return 0, why?
As I am using Vaadin, I need to have it strip off this declaration fr开发者_Python百科om the main page.
How can I do that?
You can change the doctype by overriding AbstractApplicationServlet.writeAjaxPageHtmlHeadStart() (i.e by extending ApplicationServlet and referencing your implementation in web.xml).
However:
- The problem you're seeing might not be related to the doctype at all!
- Vaadin really must not be in quirks-mode.
Regarding 1: Are you trying to read scrollTop for the entire document? Vaadin applications often scroll within the main div in which it is rendered, not the whole page.
精彩评论