[jboss-user] [JBoss Seam] - Re: By clicking every row of dataTable, show Popup to edit i

paradigmza do-not-reply at jboss.com
Thu Nov 29 07:46:24 EST 2007


like this
<a4j:form>
  | 			<rich:dataTable value="#{rowDataModel}" var="row" onRowMouseOver="this.style.backgroundColor='#EAEAEA';this.style.cursor='pointer';"
  | 				onRowMouseOut="this.style.backgroundColor='#{FFFFFF}'">
  | 					<rich:column>
  | 						<f:facet name="header">
  | 							<h:outputText value="Name" />
  | 						</f:facet>
  | 						<h:outputText value="#{row.name}" />
  | 					</rich:column>
  | 					<rich:column>
  | 						<f:facet name="header">
  | 							<h:outputText value="Age" />
  | 						</f:facet>
  | 						<h:outputText value="#{row.age}"  />
  | 					</rich:column>
  | 				<a4j:support event="onRowClick" oncomplete="Richfaces.showModalPanel('popUpPanel')" ajaxSingle="true" action="#{test.showPopUp}" reRender="popUpForm" />
  | 			</rich:dataTable>
  | 	</a4j:form>
  | 
  | 
  | 	<rich:modalPanel id="popUpPanel" resizeable="false"  autosized="true">
  | 		<f:facet name="header">
  | 			<h:outputText value="Some header" />
  | 		</f:facet>
  | 		<f:facet name="controls">
  | 			<h:graphicImage value="/img/popupclose.gif" onclick="Richfaces.hideModalPanel('crudModalPanel')"></h:graphicImage>
  | 		</f:facet>
  | 		<a4j:form id="popUpForm">
  | 			Name : #{test.name}
  | 			Age : #{test.age}
  | 		</a4j:form>
  | 	</rich:modalPanel>


and a seam component called test


  | 
  | @DataModel
  | List<User> rowDataModel;
  | 
  | @DataModelSelection
  | User selectedRow;
  | 
  | public void showPopup() {
  |      name = selectedRow.getName();
  |      age = selectedRow.getAge();
  | }

so the action in

anonymous wrote : 
  | <a4j:support event="onRowClick" oncomplete="Richfaces.showModalPanel('popUpPanel')" ajaxSingle="true" action="#{test.showPopUp}" reRender="popUpForm" />

changes the values of test.name and test.age. The popup is then displayed with the changed values.


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4108864#4108864

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4108864



More information about the jboss-user mailing list