Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <ui:composition template="/WEB-INF/templates/base.xhtml"
- xmlns="http://www.w3.org/1999/xhtml"
- xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:h="http://java.sun.com/jsf/html"
- xmlns:f="http://java.sun.com/jsf/core"
- xmlns:p="http://primefaces.org/ui">
- <ui:define name="metadata">
- <f:metadata>
- <f:event type="preRenderView" listener="#{resetPassword.loadUser}" />
- <f:viewParam name="user" value="#{resetPassword.user}" />
- </f:metadata>
- </ui:define>
- <ui:define name="content">
- <h:form rendered="#{resetPassword.user != null}">
- <h:panelGrid class="form_panel" columns="2" width="596px">
- <h:outputLabel class="form_label" for="password" value="#{base['resetPassword.password']}" />
- <h:inputSecret class="form_inputText" id="password" value="#{resetPassword.password}">
- <f:ajax event="keyup" execute="password" listener="#{resetPassword.validatePassword}" render="scorePanel complexity" />
- </h:inputSecret>
- (...) // Other labels and inputfields, no ajax
- </h:panelGrid>
- </h:form>
- </ui:define>
- </ui:composition>
- public void loadUser(ComponentSystemEvent event) {
- if(!FacesContext.getCurrentInstance().isPostback()) {
- user = (hash != null) ? userService.getByIdAndPwdResetHash(userId, hash) : null;
- }
- }
- public void validatePassword(AjaxBehaviorEvent event) {
- System.out.println("Ajax works"); // Just for testing purposes so far
- }
Add Comment
Please, Sign In to add comment