-
1. Re: How to scroll automatically to a panel?
chan32167 Apr 16, 2013 4:22 PM (in response to jeisen)Have u tried javascript window.scroll(0.0); We use that checking if there are any validation errors, and if there are we execute that window.scroll thing
/** * @return */ public boolean isExistErrors() { Severity maximunSeverity = getFacesContext().getMaximumSeverity(); if (FacesMessage.SEVERITY_ERROR.equals(maximunSeverity)) { return true; } return false; } <a4j:commandLink title="#{msg.lbl_imprimir_carta}"
action="#{siniestroController.imprimirCarta('')}"
oncomplete="if(#{siniestroController.existErrors}){window.scroll(0,0)};"
render="notificacionPanel,contentPanel">
<h:graphicImage library="images" name="ic_enviarmail.gif"
styleClass="button-link" />
</a4j:commandLink>
-
2. Re: How to scroll automatically to a panel?
jeisen Apr 17, 2013 6:35 AM (in response to jeisen)Scroll to page head in case of messages > INFO:
<h:panelGroup id="ScrollToPageHeadPanel" rendered="#{!empty facesContext.maximumSeverity and !(facesContext.maximumSeverity.ordinal lt 1)}">
<script type="text/javascript" language="javascript">
window.scrollTo(0,0);
</script>
</h:panelGroup>
I didn't get it with JQuery.