I am surprised to see that the event valueChange does not trigger when the value of an inputText is changed by a javascript method. However, it triggers when I manually change the value of the inputText.
You can test the code below to sense this, and maybe you can give a solution to make the event to trigger when a javascript function changes the value of a component.
The xhtml page:
<html xmlns="http://www.w3.org/1999/xhtml"
   xmlns:ui="http://java.sun.com/jsf/facelets"
   xmlns:f="http://java.sun.com/jsf/core"
   xmlns:c="http://java.sun.com/jsp/jstl/core"
   xmlns:h="http://java.sun.com/jsf/html"
   xmlns:p="http://primefaces.org/ui"
>
  <body>
    <script type="text/javascript">
      function testValueChange() {
        console.log("testValueChange called");
        var inputHCodes = document.getElementById('form:inptHCodes');
        inputHCodes.value = "new value";
      }
    </script>
    <h:form>
      <p:commandButton type="button" value="BUTTON" onclick="testValueChange();"/>
      <h:inputText id="inptHCodes" value="#{questionnaireExtendedKeyAttribute.selectedInputCodes}">
        <p:ajax event="valueChange" listener="#{questionnaireExtendedKeyAttribute.testValueChangeListener}"/> 
      </h:inputText>
    </h:form>
  </body>
</html>
The listener in backing bean:
public void testValueChangeListener(AjaxBehaviorEvent abe) {
   UIInput uiinput = (UIInput) abe.getSource();
   String id = uiinput.getId();
   selectedInputCodes = uiinput.getValue().toString();
   logger.debug("### value : " + selectedInputCodes + " and id is: " + id);
}
