Java Mailing List Archive

http://www.junlu.com/

Google
Google
Mailing List
Home
Forum Home
JBoss - Java Application Server
Tomcat - JSP/Servlet container
Struts - A MVC web framework
iText - An open source PDF Java Library
JDOM - JDOM XML Parser
J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition
JSP - A mailing list about Java Server Pages specification and reference
J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog
Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology
Struts & Hibernate
Subjects
JSP editor plugin for eclipse ?
org apache jasper JasperException: Unable to compile class for JSP
Tomcat: Connection reset by peer: socket write error
Cannot retrieve definition for form bean null
Struts Tiles Tutorial (free Struts training)
Where do I download Tomcat 4 0 6?
Data Access Object (DAO) pattern, example DAO 's
Where to download Tomcat v 4 1 24 from?
Tomcat 5 0 16 Requested resource not available
Oracle Connection Pooling in 3 2 2
Servlet : Session invalidate
Servlet action is currently unavailable
Tomcat/Struts Unicode Encoding/Decoding problems
Tomcat and webapplication specific java library path
Running a Simple JMS Example
Mapping in workers2 properties
org apache jasper JasperException
Cannot find message resources under key org apache struts action
   MESSAGE
problem with html:text bean throwing exception
Cannot find message resources under key org apache struts action MESSAGE
invalid direct reference problem with solution
Tool for jsp debug Try Sysdeo Eclipse Plugin
Tomcat 5 Cannot load JDBC driver class 'null ' SQL state: null
weblogic ejbc
java properties file
Jboss 3 2 3 Coyote Can 't re
Tomcat 5, Apache2 and mod jk2 integration problem
JBoss example problem new to J2EE
url string for connecting jboss to oracle
Value attribute of <html:checkbox
javax servlet ServletException: BeanUtils populate
HTTP Status 404 The requested resource is not available
5 0 18: Windows XP Pro vs Windows 2000
 
- EntityQuery.refresh() doesn 't clear the result list?

- EntityQuery.refresh() doesn 't clear the result list?

2007-07-18       - By ASavitsky

 Back
Not sure whether it's a bug, or just me, but it doesn't look like the refresh()
method is doing anything for me - the result list is stale and never refreshes,
until I start a new coversation...

I have a simple CRUD screen where the edit form is combined with the record
listing:
<h:form id="listForm" styleClass="form">
 |   <ui:repeat var="transaction" value="#{userTransactions.resultList}">
 |     <h:commandLink action="#{transactionController.select(transaction)}"
value="#{transaction.account.accountNumber} " />
 |   </ui:repeat>
 |   <h:commandButton action="#{transactionController.create}" value="Add New"
/>
 | </h:form>
 | <h:form id="rowForm" styleClass="form" rendered="#{not empty
selectedTransaction}">
 | <!-- form fields go here -->
 |   <h:commandButton action="#{transactionController.save}" value="Save" />
 |   <h:commandButton action="#{transactionController.remove}" value="Remove"
immediate="true" rendered="#{not selectedTransaction.new}" />
 |   <h:commandButton action="#{transactionController.cancel}" value="Close"
immediate="true" />
 | </h:form>
The query for record listing is an EntityQuery defined in components.xml:
<framework:entity-query name="userTransactions" scope="conversation" order=
"transactionDate, securityName">
 |   <framework:ejbql>
 |     FROM Transaction
 |     WHERE user = #{principal}
 |   </framework:ejbql>
 | </framework:entity-query>
and the controller code has the EntityQuery injected, and refreshes the list as
necessary:
@(protected) ("transactionController")
 | @(protected) (ScopeType.CONVERSATION)
 | public class TransactionController extends BaseController {
 |   @(protected) (required = false)
 |   private Transaction selectedTransaction;
 |   @(protected) EntityQuery userTransactions;
 |
 |   public void cancel() {
 |     selectedTransaction = null;
 |   }
 |   public void create() {
 |     selectedTransaction = new Transaction();
 |   }
 |   @(protected)
 |   public void remove() {
 |     em.remove(selectedTransaction);
 |     em.flush();
 |     selectedTransaction = null;userTransactions.refresh();
 |   }
 |   @(protected)
 |   public void save() {
 |     em.persist(selectedTransaction);
 |     em.flush();
 |     selectedTransaction = null;userTransactions.refresh();
 |   }
 |   public void select(Transaction transaction) {
 |     selectedTransaction = transaction;
 |   }
 | }
The whole thing runs in a long conversation, started when the page is entered:
<page view-id="/attestation/transactions.xhtml">
 |   <begin-conversation flush-mode="manual" join="true" />
 | </page>

Now, any time a new record is inserted, or an old one removed, the list should
refresh, shouldn't it? It doesn't, and I'm running out of any ideas on to why
would this happen... Help, anyone?

Thanks,

Alex

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

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode
=reply&p=4065436
__ ____ ____ ____ ____ ____ ____ ____ ____ ____
jboss-user mailing list
jboss-user@(protected)
https://lists.jboss.org/mailman/listinfo/jboss-user

©2008 junlu.com - Jax Systems, LLC, U.S.A.