Button p:InputExtArea在光标位置设置文本

Button p:InputExtArea在光标位置设置文本,button,primefaces,position,cursor,Button,Primefaces,Position,Cursor,如何在我的p:InputExtArea中的按钮处添加预定义文本 <p:commandButton onClick="setThisTextToMyInpuTextArea" 我该怎么做? 感谢您的回答解决方案可以是使用actionListener调用设置变量值的方法,然后在commandButton中更新此组件。 比如: <p:commandButton update="yourTextarea" actionListener="#{yourBean.setText}"/>

如何在我的p:InputExtArea中的按钮处添加预定义文本

<p:commandButton onClick="setThisTextToMyInpuTextArea"
我该怎么做?
感谢您的回答

解决方案可以是使用actionListener调用设置变量值的方法,然后在commandButton中更新此组件。 比如:

<p:commandButton update="yourTextarea" actionListener="#{yourBean.setText}"/>

谢谢你的帮助。但什么是setVar?你能把解决方案的全部代码都贴出来吗?非常感谢你
public void setText(){
    setVar="Text";
}