JSF 2.0 composition components datatable update issue

UI Components for JSF
Post Reply
dreampeppers99
Posts: 3
Joined: 22 Feb 2011, 13:52

22 Feb 2011, 15:00

I'm trying to use the primefaces.2.2.1 with the new composition model of jsf 2.0 components. I'm creating a separated jar project (META-INF/resources). So I divide my list and edit pages into several components ... in what the most important are : listControl and listTable (for the list page)

listControl

Code: Select all

	<composite:interface>
		<composite:attribute name="bean" required="true" />
		<composite:attribute name="canRaiseUpdateAt" required="true" />
	</composite:interface>

	<composite:implementation>
						<h:selectOneMenu style="text-align:center;" value="#{cc.attrs.bean.fieldToSearch}">
							<composite:insertChildren />
						</h:selectOneMenu>&#160;
						<p:commandButton action="#{cc.attrs.bean.search}" update="#{cc.attrs.canRaiseUpdateAt},mMessages,gMessages," />&#160;
						<h:commandButton action="#{cc.attrs.bean.goCreate}"/>&#160;
	</composite:implementation>
listTable

Code: Select all

	<composite:interface>
		<composite:attribute name="bean" required="true" />
		<composite:attribute name="idTable" required="true" />
		<composite:attribute name="rows" default="10" />
		<composite:attribute name="paginator" default="true" />
		<composite:attribute name="paginatorPosition" default="bottom" />
	</composite:interface>
	<composite:implementation>
				<div align="center">
					<p:dataTable paginatorPosition="#{cc.attrs.paginatorPosition}" paginator="#{cc.attrs.paginator}" rows="#{cc.attrs.rows}" id="#{cc.attrs.idTable}" var="entity" value="#{cc.attrs.bean.entities}">
						<composite:insertChildren />
					</p:dataTable> 
				</div>
	</composite:implementation>
The use

Code: Select all

	               <wetsand:listControl bean="#{bean}" canRaiseUpdateAt="tableId">
				<f:selectItem itemValue="name" itemLabel="Name"/>
				<f:selectItem itemValue="id" itemLabel="Id"/>
			</wetsand:listControl>
			
			<wetsand:listTable	bean="#{bean}" idTable="tableId">
				<p:column sortBy="#{entity.id}" filterBy="#{entity.id}">
					<f:facet name="header">
						<h:outputText value="Id" />
					</f:facet>
					<h:outputText value="#{entity.id}"/>
				</p:column>
		      </wetsand:listTable>
So when I click on search button it should update (ajax refresh) tableId but it does not happened! I did check and the action is fired the sql on database is done!
Is there anything I'm doing wrong?
Another thing,, I was wondering to pass var attribute from dataTable by attribute... but it does not work with me... is there any way to do that too?

In the past I used to use the following: bean[action] (where action could be action or even property) on composting facelets... is that still possible on JSF 2.0 componenents?

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: Google [Bot] and 35 guests