[jboss-user] [JBoss Seam] - Re: ajax and EntityHome (Conversation) bug?!

mrohad do-not-reply at jboss.com
Sat Aug 18 08:27:51 EDT 2007


what i am trying to do here is:
a table of customers
when someone clikc on spesfic row(customer) then  I show a pop-up
with the customer details
and then I would like to change the details and press update.

when I add the following code to pages.xml:

  | <page view-id="/customer/index.xhtml" action="#{conversation.begin}">
  | 	</page>
my pop up is showing empty fields :(
\here is my xhtml all over again , shorter..

  | <?xml version="1.0" encoding="Windows-1255" ?>
  | <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
  |                              "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
  | 
  | <ui:composition xmlns="http://www.w3.org/1999/xhtml"
  | 	xmlns:s="http://jboss.com/products/seam/taglib"
  | 	xmlns:ui="http://java.sun.com/jsf/facelets"
  | 	xmlns:f="http://java.sun.com/jsf/core"
  | 	xmlns:h="http://java.sun.com/jsf/html"
  | 	xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
  | 	xmlns:rich="http://richfaces.ajax4jsf.org/rich"
  | 	template="/layout/template.xhtml">
  | 
  | 	<ui:define name="body">
  | 		
  | 		<h:messages globalOnly="true" styleClass="message" id="globalMessages" />
  | 		<!-- FILTER -->
  | 		<a4j:form id="customerSearch" styleClass="edit" dir="rtl">
  | 			<rich:simpleTogglePanel label="     ????? ??????        "
  | 				switchType="client" style="direction:rtl">
  | 
  | 				<s:decorate template="/layout/display.xhtml">
  | 					<ui:define name="label">name</ui:define>
  | 					<h:inputText id="name" value="#{customerList.customer.name}" />
  | 				</s:decorate>
  | 
  | 
  | 			</rich:simpleTogglePanel>
  | 
  | 			
  | 
  | <div class="actionButtons">
  | 			<a4j:commandButton
  | 				reRender="customerTable" value="filter" /></div>
  | 
  | 
  | 		<rich:panel id="customerTable">
  | 			<f:facet name="header">table</f:facet>
  | 			<div class="results" id="customerList">
  | 			
  | 		<a4j:region >
  | 		<rich:dataTable
  | 				onRowMouseOver="this.style.backgroundColor='#F1F1F1'"
  | 				onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"
  | 				id="customerListTable" var="customer" value="#{customerList.customers}"
  | 				rowKey="#{customer.id}" rowKeyVar="custId"			>
  | 				
  | 		
  | 				<rich:column>
  | 					<f:facet name="header">
  | 						<s:link styleClass="columnHeader"
  | 							value="id #{customerList.order=='id asc' ? messages.down : ( customerList.order=='id desc' ? messages.up : '' )}">
  | 							<f:param name="order"
  | 								value="#{customerList.order=='id asc' ? 'id desc' : 'id asc'}" />
  | 						</s:link>
  | 					</f:facet>
  |             #{customer.id}
  |         </rich:column>
  | 				<rich:column>
  | 					<f:facet name="header">
  | 						<s:link styleClass="columnHeader"
  | 							value="name #{customerList.order=='name asc' ? messages.down : ( customerList.order=='name desc' ? messages.up : '' )}">
  | 							<f:param name="order"
  | 								value="#{customerList.order=='name asc' ? 'name desc' : 'name asc'}" />
  | 						</s:link>
  | 					</f:facet>
  |             #{customer.name}
  |         </rich:column>
  | 	
  | 				<a4j:support event="onRowClick" 
  | 				oncomplete="javascript:Richfaces.showModalPanel('custForm:panel')" 
  | 				reRender="panel" data="#{rowKey}" 
  | 				actionListener="#{customerHome.selectCustomerFromTable}">
  | 				<s:conversationId/>
  | 				<a4j:actionparam name="cust" id="cust" assignTo="#{customerHome.id}" value="#{customer.id}"/>
  | 				</a4j:support>
  | 				
  | 			</rich:dataTable>
  | 			</a4j:region>
  | 			</div>
  | 		</rich:panel></a4j:form>
  | 		<!-- POPUP -->
  | 		<a4j:region id="popupregion">
  | 		<a4j:form id="custForm">
  | 		<rich:modalPanel id="panel" width="400" height="400">
  | 			<f:facet name="header">
  | 				<h:outputText value="edit customer" />
  | 			</f:facet>
  | 			
  | 				<h:panelGrid columns="1">
  | 				<s:decorate template="/layout/display.xhtml">
  | 					<ui:define name="label">id</ui:define>
  | 					<h:inputText id="custId" value="#{customerHome.instance.id}" />
  | 				</s:decorate>
  | 				<s:decorate template="/layout/display.xhtml">
  | 					<ui:define name="label">name</ui:define>
  | 					<h:inputText id="name" value="#{customerHome.instance.name}" />
  | 				</s:decorate>
  | 
  | 				
  | 				<a4j:commandButton id="updateCustomerButton"  reRender="customerListTable" action="#{customerHome.update}" ajaxSingle="true" value="UPDATE" 
  | 				oncomplete="javascript:Richfaces.hideModalPanel('custForm:panel')" >
  | 				<s:conversationId/>
  | 				</a4j:commandButton>
  | 				 <h:commandButton onclick="javascript:Richfaces.hideModalPanel('custForm:panel')" value="close"></h:commandButton>
  | 				</h:panelGrid>
  | 
  | 		</rich:modalPanel>
  | 		</a4j:form>
  | 		</a4j:region>
  | 		
  | 
  | 	</ui:define>
  | </ui:composition>
  | 

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

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



More information about the jboss-user mailing list