1 Reply Latest reply on Oct 8, 2007 5:49 AM by Ilya Shaikovsky

    How to refresh a UI component from java code

    Rakesh Patnaik Newbie

      I have a usecase where on selection change of a radio button I want to refresh a chart in the same page. On selection change of the radio button I get the corresponding action listener in the java code get invoked. Now depending on some condition I might want to refresh the chart in the UI besides the radio button. How can I push a refresh event of the chart component from the java code in the action listener?

      I tried the a4j:support but that cannot be told to refresh the chart conditionally. May be we could value bind the reRender to achieve this but just dont want to do it this way.

      For example in trinidad we have the support of RequestContext that helps PPR as follows:
      if (_needToRepaint())
      // Repaint another component programatically
      UIComponent chart = getViewRoot().findComponent("chartID");
      RequestContext rc = RequestContext.getCurrentInstance();