p:terminal does not have a update attribute.
Does it support any kind of ajax event?
how do I update another jsf component as a response to a terminal command?
p:terminal does not have a update attribute.
Does it support any kind of ajax event?
how do I update another jsf component as a response to a terminal command?
It does not have any ajax events as can be seen in the documentation and/or the source. But in the implementation of commands for the terminal that you implement yourself, you can do anything you want. Including using the RequestContext to update other components.
At least that is what I expected (and did not explicitly test, sorry). Updating from the commandHandler does not work since the commandHandler is called during the render response phase and you cannot add updates to components in that phase.
See also the comment on the answer here: Can I update a JSF component from a JSF backing bean method?.
So the actual good answer is the one from the @Leo himself (although this answer helped a little ;-))
Here what worked for me
<p:terminal
id="terminal"
widgetVar="term"
prompt="Lab >> "
commandHandler="#{labMB.handleCommand}"
welcomeMessage="Welcome to Lab" />
<p:remoteCommand
name="rc"
update="history" />
<p:dataTable
id="history"(...)
and
public String handleCommand(String command, String[] params) {
RequestContext context = RequestContext.getCurrentInstance();
//(do things here)
context.execute("rc();");
}
it seems that just calling
context.update("form:history");