Is there a way to ajax-update a specific component such as a <h:form>
in backing bean?
I tried the following using RequestContext#execute()
,
RequestContext context = RequestContext.getCurrentInstance();
context.execute("monitorVehicleForm.update()");
however that didn't seem to have any effect.
The
RequestContext#execute()
only executes arbitrary JavaScript code which is been passed-in as argument. It does not ajax-update the client representation of the components.You need
RequestContext#update()
instead wherein you just pass the client ID of the to-be-updated component.This has exactly the same effect as
<p:commandXxx ... update="monitorVehicleForm">
. This works provided you've awithout any
NamingContainer
parent and thus have ain the generated HTML.
See also: