2 Replies Latest reply on Aug 16, 2008 1:11 PM by Lincoln Baxter III

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

    Lincoln Baxter III Master

      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}"
      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"
      validator="#{indexBean.validateWhisper}" required="true">
      </h:inputText> <h:commandButton id="whisperButton"
      action="#{indexBean.doWhisper}" value="whisper" /></div>