1 Reply Latest reply: Jun 19, 2012 1:36 PM by 186148 RSS

    embedded JavaScript in jsff not available until after refresh browser

    186148
      Hi,
      Not sure if this is a JHS issue or JDev, so posting in both places.

      I have an issue with an af:clientListener which executes some custom javaScript embedded in the jsff file. This is a multiple tab application. I am using a clientListener and javaScript to capture the return key and then click a button. The button then executes a managed bean method.

      When the jsff page is first loaded this does not work. Using firebug I do not see the javascript. If I manually refresh the browser the javascript shows up in firebug and the process works. If I tab to another page and then tab back the process is boken again and the javascript is missing, until I refresh the browser again.

      Can anyone shed some light on this behavior? I have tried to find a way to refresh the browser programatically after the page loads, but no success. And this does not seem like the proper way to solve the problem anyway.


      Jdev 11.1.1.5
      JHS 11.1.1.4.26

      <af:panelGroupLayout layout="vertical" id="ArchivedBoxReconQueryTopLc"
      partialTriggers=" ArchivedBoxReconQueryfbb ArchivedBoxReconQuerySaveButton ArchivedBoxReconQueryCancelButton">
      <!-- DEBUG:BEGIN:GROUP_ACTION_ATTRIBUTES : customtemplates/archivedmsds/groupActionAttributes_BoxReconQuery.vm, nesting level: 5 -->
      <trh:script id="s2" text="
      function *MSDSOnkeyEnter(event) {*
      if (window.event) {
      if(window.event.keyCode == 13){
      document.getElementById('pt:mr:0:pt:*ArchivedBoxReconQueryAddMsdsToList*').click();
      return true; }
      } else {
      if(event.Event.keyCode == 13){
      document.getElementById('pt:mr:0:pt:*ArchivedBoxReconQueryAddMsdsToList'*).click();
      return true; }
      }
      return false;
      }"></trh:script>


      <af:panelLabelAndMessage id="ArchivedBoxReconQueryAddMsdsToListPlm">
      <af:commandButton id="*ArchivedBoxReconQueryAddMsdsToList*"
      textAndAccessKey="Add MSDS ID"
      action="#{ArchivedBoxReconTempBBean.ArchivedBoxReconQueryAddMsdsToList_action}"></af:commandButton>
      <f:facet name="end">
      <af:panelGroupLayout id="pgl1" valign="top"
      layout="horizontal"></af:panelGroupLayout>
      </f:facet>
      </af:panelLabelAndMessage>
      <!-- DEBUG:END:FORM_COMMAND_BUTTON : default/item/form/formCommandButton.vm, nesting level: 10-->
      <!-- DEBUG:BEGIN:FORM_TEXT_INPUT : customtemplates/archivedmsds/formTextInput_ReconQueryMsdsScanNo.vm, nesting level: 10 -->
      <af:inputText id="ArchivedBoxReconQueryMsdsScanNo"
      value="#{bindings.ArchivedBoxReconQueryMsdsScanNo.inputValue}"
      label=" " required="false"
      autoSubmit="true" immediate="true"
      clientComponent="true">
      <f:validator binding="#{bindings.ArchivedBoxReconQueryMsdsScanNo.validator}"/>
      *<af:clientListener method="MSDSOnkeyEnter"*
      type="keyPress"/>
      </af:inputText>

      Edited by: 170412 on Jun 19, 2012 10:24 AM