Jsf 使用actionListener写入inputText
我最近使用primefaces和jsf在xhtml中编程;现在感觉有点不舒服;希望你能帮助我。我的第一个问题 我的问题是:我有一个输入文本,然后是一个p:对话框,显示一个有两列的panelgrid:一列包含代码,另一列包含按钮。如何将所选代码写入输入文本?在按钮上使用actionListener?还是Jsf 使用actionListener写入inputText,jsf,primefaces,actionlistener,Jsf,Primefaces,Actionlistener,我最近使用primefaces和jsf在xhtml中编程;现在感觉有点不舒服;希望你能帮助我。我的第一个问题 我的问题是:我有一个输入文本,然后是一个p:对话框,显示一个有两列的panelgrid:一列包含代码,另一列包含按钮。如何将所选代码写入输入文本?在按钮上使用actionListener?还是 <p:inputText id="codice_tributo_1" size="5"></p:inputText> <p:commandButton id="sh
<p:inputText id="codice_tributo_1" size="5"></p:inputText>
<p:commandButton id="showDialogButton" type="button" value="Show"
onclick="PF('dlg').show()" />
<p:dialog header="Codici" widgetVar="dlg" appendToBody="true"
resizable="false">
<h:form id="form">
<p:panelGrid>
<p:row>
<p:column>
<p:outputLabel id="codice1">34567890</p:outputLabel>
</p:column>
<p:column>
<p:commandButton icon="ui-icon-carat-1-w" oncomplete="PF('dlg').hide();"></p:commandButton>
</p:column>
</p:row>
<p:row>
<p:column>
<p:outputLabel>3twgehrdnftg</p:outputLabel>
</p:column>
<p:column>
<p:commandButton icon="ui-icon-carat-1-w" oncomplete="PF('dlg').hide();"></p:commandButton>
</p:column>
</p:row>
</p:panelGrid>
</h:form>
</p:dialog>
34567890
3TWGEHRNDFTG
我也是JSF新手,但以下是我将尝试的:
inputText
字段的值绑定到支持bean李>
actionListener
添加到commandButtons
,并使用它调用支持bean上的方法,将代码作为参数传入李>
inputText
字段备份值中update
属性添加到commandButtons
,并使用它更新inputText
组件