0 Replies Latest reply on Jun 10, 2008 2:33 AM by rolandotr

    a4j:support no updating some components

    rolandotr

      Here I have an example, almost the same that richfaces reference show

      <h:form>
      <h:inputText value="#{bean.text}">
      <a4j:support event="onkeyup" reRender="repeater" />
      </h:inputText>

      <h:inputText id="repeater" value="#{bean.text}" />

      </h:form>

      I change h:outputText for h:inputText and doesn´t work.

      I would like to know why thats happen, because apparently the same problem appear whit this code:

      <h:form>
      <h:inputText value="#{bean.text}">
      <a4j:support event="onkeyup" reRender="repeater" />
      </h:inputText>

      <h:outputText id="repeater" binding="#{bean.outputText}" />

      </h:form>

      Here it is the bean, just in case:

      package bean;

      import javax.faces.component.html.HtmlOutputText;

      import org.apache.commons.logging.Log;
      import org.apache.commons.logging.LogFactory;

      public class Bean {

      private static final Log log = LogFactory.getLog(Bean.class);

      protected String text;

      public String getText() {
      return text;
      }

      public void setText(String text) {
      this.text = text;
      }

      protected HtmlOutputText outputText;

      public HtmlOutputText getOutputText() {
      if (log.isDebugEnabled())
      log.debug(">>> se pidio el outputtext");
      if (outputText == null) outputText = new HtmlOutputText();
      outputText.setValue(getText());
      return outputText;
      }

      public void setOutputText(HtmlOutputText outputText) {
      if (log.isDebugEnabled())
      log.debug(">>> Se seteo el outputext");
      this.outputText = outputText;
      }


      }

      If you test this, you can see that every time the event keyup is fire, only the method setOutputText is invoke.

      Best regards, I hope you can tell me something.