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

    embedded JavaScript in jsff not available until after refresh browser

      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.


      <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){
      return true; }
      } else {
      if(event.Event.keyCode == 13){
      return true; }
      return false;

      <af:panelLabelAndMessage id="ArchivedBoxReconQueryAddMsdsToListPlm">
      <af:commandButton id="*ArchivedBoxReconQueryAddMsdsToList*"
      textAndAccessKey="Add MSDS ID"
      <f:facet name="end">
      <af:panelGroupLayout id="pgl1" valign="top"
      <!-- 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"
      label=" " required="false"
      autoSubmit="true" immediate="true"
      <f:validator binding="#{bindings.ArchivedBoxReconQueryMsdsScanNo.validator}"/>
      *<af:clientListener method="MSDSOnkeyEnter"*

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