You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by mjovanov <mi...@jpmchase.com> on 2006/07/25 18:55:41 UTC

Pageable (Through Sub-selects), Sortable, Dynamic Cols dataTable Issuue

Ok, this is driving me absolutely crazy: I have a drop-down menu allowing a
user to select from a list of reports, the results of which are then
displayed in a table on the same page.  The table has paging (request scope,
through sub-selects) and sorting.  I got all this to work for one of the
reports and am now trying to get it so that when a user selects a different
report the data structures backing the table are dynamically changed.  For
this, I need a value-change event triggered by the UISelectOne component to
take place after Update Model Phase (so that I can reset the DataModel after
it has been retrieved from previous request).  Someone suggested a way to do
this using a hidden commandLink as follows:
http://www.nabble.com/Can-UISelectOne-Trigger-an-Action-Event--tf1981993.html#a5439491.

However, after I did this, all of a sudden sorting stopped working.  I
realized that the action event that used to fire when a user clicked on a
column header (to sort the data) is no longer firing (incidentally, this is
the same action event that I am now triggering when a user selects a
different report from a drop-down menu).  Searching through other posts, I
found out that sometimes the reason for this is that the component that is
suppose to queue the action event may not exist (rendered=false) during the
entire time from the first request renderResponse phase to the next
request's invokeApplication phase (see
http://www.nabble.com/actionListener-not-invoked-tf1317007.html#a3544909). 
However, since the actionListener attribute is set on the
t:commandSortHeader, I am not sure how exactly to utilize t:savestate.  Any
suggestions would be greatly appreciated.

				<t:dataTable id="queueDetails"
					styleClass="recordSetTable"
					headerClass="resultSetTableHeader"
					rowClasses="cellDataAltRow,cellDataFirstRow"
					var="row" 
					preserveDataModel="true"
					binding="#{workbenchForm.data}"
					value="#{workbenchForm.dataModel.value}"
					rows="#{workbenchForm.dataModel.rows}"
					sortColumn="#{workbenchForm.dataModel.sortColumn}"
					sortAscending="#{workbenchForm.dataModel.sortAscending}"
					preserveSort="true" >
					<t:columns id="columns" value="#{workbenchForm.columns}" var="column" 
>
						<f:facet name="header">
							<t:commandSortHeader columnName="#{column.label}" immediate="false"
arrow="true" actionListener="#{workbenchForm.actionListener}"
styleClass="cellDataHeader">
								<h:outputText value="#{column.label}" />
							</t:commandSortHeader>
						</f:facet>
						<h:outputText value="#{workbenchForm.columnValue}" />
					</t:columns>
				</t:dataTable>

-- 
View this message in context: http://www.nabble.com/Pageable-%28Through-Sub-selects%29%2C-Sortable%2C-Dynamic-Cols-dataTable-Issuue-tf1999409.html#a5489187
Sent from the MyFaces - Users forum at Nabble.com.