Partial rendering via FacesContext
jsf
Solution
You can programmatically add render IDs to `PartialViewContext#getRenderIds()`.
FacesContext.getCurrentInstance().getPartialViewContext().getRenderIds().add("form:dataTable");
Note that this can contain only absolute client IDs and should not be prefixed with `:`.
Problem
actually I got a inputText and some ajax Request to render a datatable when a keyup event appears. mypage.xhmtl: ``` <h:form id="form"> <h:inputText id="number_in" value="#{bean.number}" redisplay="false" > <f:ajax event="keyup" render=":form:dataTable" /> </h:inputText> <h:dataTable id="dataTable" ...> ... </h:dataTable> <h:form> ``` I don't want to render the dataTable from the jsf page anymore. I want to render the dataTable in a MangedBean by FacesContext when a listener method is invoked. mypage.xhtml: ``` <h:form id="form"> <h:inputText id="number_in" value="#{bean.number}" redisplay="false" > <f:ajax event="keyup" listener="#{bean.onKeyup}" /> </h:inputText> <h:dataTable id="dataTable" ...> ... </h:dataTable> ``` mybean.java: ``` @ManagedBean(name="bean") @SessionScoped public class Bean { ... public void onKeyUp(AjaxBehaviorEvent event) { //Here I want to render the dataTable } ... } ``` How can I achieve that?