ScrollPosition |
||
|
Developer’s Guide Home
Installation and Configuration Components Index Calendar Chart Confirmation Data Table Date Chooser Drop Down Field Dynamic Image Folding Panel Graphic Text Hint Label Popup Layer Suggestion Field Tab Set Tabbed Pane Tree Table Two List Selection Focus Load Bundle Scroll Position Ajax Support Validation Framework Tag Reference |
The ScrollPosition component is a non-visual component that controls the scroll position of the page. By using it, you can specify the position of the scroll when the page is loaded and save the scroll position between page submissions. Note that there can be only one ScrollPosition component on the page. Specifying Scroll Position ComponentTo add the ScrollPosition component on the page, use the <q:scrollPosition> tag. When this component is added, the scroll position is saved automatically. The ScrollPosition component has a boolean autoSaveScrollPos attribute. By default, it is set to "true", which means that the scroll position is saved between page submissions. <h:form>
<q:scrollPosition autoSaveScrollPos="true"/>
</h:form>
Specifying Scroll Position on Page LoadYou can specify the position of the scroll on page load by using the int scrollX and scrollY attributes. In these attributes, you should specify the x and y coordinates of the left bottom corner of the currently visible page. <h:form> <q:scrollPosition scrollX="0" scrollY="700"/> </h:form> If the autoSaveScrollPos attribute is set to "true", the scroll position is saved into the scrollX and scrollY attributes between page submissions. Tracking Scroll Position For the Entire ApplicationYou can also set the teamdev.jsf.autoSaveScrollPos context attribute in web.xml to "true" (the default is "false") to track the scroll position for all application pages. <context-param>
<param-name>teamdev.jsf.autoSaveScrollPos</param-name>
<param-value>true</param-value>
</context-param>
|
|
| © 2009 TeamDev Ltd. | ||