2 Replies Latest reply on Aug 16, 2008 1:11 PM by lincolnthree

    a4j:form data="#{}" does not populate javascript data variab

    lincolnthree

      When using the a4j:form component, the data="#{managedBean.property}" attribute is not correctly causing the javascript data variable to be populated.

      See example below. data is always undefined, even if the managed bean property is set to a valid value, the alert box shows undefined.
      I verified that when using a4j:commandButton, the data variable is correctly populated, and the alert box displays the value.

      Does anyone know how to fix this? Thanks

      <a4j:form id="themouth" data="#{indexBean.ajaxInputOk}"
      reRender="whispers,earInput,earErrors"
      oncomplete="alert(data)" ajaxSubmit="true">
      <div class="centered paddingLarge"><h:outputText
      id="whispers" styleClass="smallText" value="#{indexBean.whispers}" /></div>
      
      <div class="centered" id="earWhisper"><a4j:outputPanel id="earErrors">
      <h:message showSummary="true" showDetail="false" for="earInput"
      style="color: red;" />
      </a4j:outputPanel><br />
      
      <h:inputText id="earInput" autocomplete="off"
      value="#{indexBean.input}"
      validator="#{indexBean.validateWhisper}" required="true">
      
      </h:inputText> <h:commandButton id="whisperButton"
      action="#{indexBean.doWhisper}" value="whisper" /></div>
      
      </a4j:form>