I'm developping a composite component containing a p:inputText, a p:commandButton that displays a dialog. In this dialog there is a p:dataTable. When I select an item in this dataTable, the dialog closes and the text field is updated with the selected value.
My problem is how to set the parameter "update" of the ajax event of my dataTable.
Here is my code:
Code: Select all
<cc:interface>
<cc:editableValueHolder name="value" required="true" />
<cc:attribute name="popupRows" required="false" />
<cc:attribute name="popupColumns" required="false" />
<cc:attribute name="popupSelection" required="false" />
</cc:interface>
<cc:implementation>
<h:inputText id="custom_input_text" value="#{cc.attrs.value}" />
<p:commandButton styleClass="omg-taglist" onclick="#{cc.attrs.id}_dialog_widget.show();" value="Show"/>
<p:dialog id="taglist_dialog" resizable="false" modal="true" widgetVar="#{cc.attrs.id}_dialog_widget" visible="false" draggable="false">
<p:dataTable id="search_tagList_dialog_dataTable" var="item"
value="#{cc.attrs.popupRows}"
selection="#{cc.attrs.popupSelection}"
selectionMode="single">
<p:ajax event="rowSelect" update="[b]custom_input_text[/b]" oncomplete="#{cc.attrs.id}_dialog_widget.close();"/>
<p:columns value="#{cc.attrs.popupColumns}" var="column"
columnIndexVar="colIndex">
<f:facet name="header">
#{column.header}
</f:facet>
#{item[column.property]}
</p:columns>
</p:dataTable>
</p:dialog>
</cc:implementation>
Code: Select all
<h:form id="myform">
<cc:TagList id="mycc" value="#{mybean.value}" popupRows="#{mybean.rows}" popupColumns="#{mybean.columns}" popupSelection="#{mybean.selection}" />
</h:form>
Code: Select all
<p:ajax event="rowSelect" update="[b]custom_input_text[/b]" />
Code: Select all
<p:ajax event="rowSelect" update="[b]myform:mycc:custom_input_text[/b]" />
I'm using PrimeFaces 3.0.M3-SNAPSHOT and jsf 2.1.2
Thanks for any help!