3 Replies Latest reply on Oct 17, 2011 11:12 AM by Christian Peter

    Alternatives To Multiple A4J:Support Tags

    Lee Theobald Newbie

      Hi all,


      I'm trying to implement a password strength meter on a password field.  As you type in your password, you are given the strength of what you have typed so far.  I originally had something like this:


      {code}<h:inputSecret id="userPassword" value="#{changePasswordAction.plainTextPassword1}" required="true" valueChangeListener="#{changePasswordAction.checkPasswordStrength}">

        <a4j:support event="onkeydown" reRender="pwordstrength" ajaxSingle="true" />


      <h:outputText id="pwordstrength" styleClass="pwordstrength #{changePasswordAction.passwordStrengthClass}" value="#{changePasswordAction.passwordStrength}" />{code}


      Which works OK.  But one of the troubles is that if you paste in a password into that box, using your mouse, then the strength indicator isn't updated (as no key is pressed).  A quick look around on the internet and it appears I have three events I should ideally look for: onkeydown, onpaste & oninput.  If I try using this as three a4j:support tags, only the first fires.  So can anyone else suggest a way for me to be able to fire off a rerender on these three events?