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
 
- JSF/Bean binding dropped when using s:link

- JSF/Bean binding dropped when using s:link

2007-06-12       - By thatrichard

 Back
Short version: When I navigate using an s:link then any data entered into form
fields disappears.  Everything works ok when I use commandLinks.

Long version:
I've created a tabbed form using a conversation.  The user moves between tabs
by clicking on links.  At any time, the user can persist the form data by
pressing a Save button.

Here is the Session Bean and JSF pages (the first JSF page creates the tabs,
the second creates a tab which is inserted into the first).

Note that I've duplicated the tab links.  The link with the 2 appended is
implemented with commandLink and the second one with s:link.

If I use the commandLinks, everthing behaves as expected.  I can navigate
between the tabs and enter data.  When I hit save the data is persisted.
However, when I use the s:links then the data disappears.  For example, if I
enter a last name and then navigate to the second tab and back, the last name
has disappeared.

Does anyone know what is going on?

Richard


 | @(protected)("personEditor")
 | @(protected)
 | @(protected)(ScopeType.CONVERSATION)
 | @(protected)  
 | public class PersonEditorBean implements PersonEditor {
 |  
 |   private Person person;
 |
 |   @(protected)
 |   private Session session;
 |  
 |   @(protected)
 |   private Log log;
 |
 |   @(protected)(required=false)
 |   public void setPerson(Person person) {
 |     this.person = person;
 |   }
 |  
 |   @(protected)
 |   public Person getPerson() {
 |     if (person == null) {
 |       person = new Person();
 |     }
 |     return person;
 |   }
 |  
 |   @(protected)(flushMode=FlushModeType.MANUAL, join=true)
 |   public String enterIdentity() {
 |     return "/forms/party/person/identity";
 |
 |   }
 |  
 |   public String enterBanking() {
 |     return "/forms/party/person/banking";
 |
 |   }
 |
 |   public void save() {
 |     session.save(person);
 |     session.flush();
 |   }  
 |
 |   @(protected) @(protected)
 |   public void destroy() { }
 | }


 | <?xml version="1.0" encoding="UTF-8 (See http://UTF-8.ora-code.com)"?>
 | <!DOCTYPE html
 |   PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR
/xhtml1/DTD/xhtml1-transitional.dtd">
 | <html xmlns:f="http://java.sun.com/jsf/core"
 |   xmlns:h="http://java.sun.com/jsf/html"
 |   xmlns:ui="http://java.sun.com/jsf/facelets"
 |   xmlns:s="http://jboss.com/products/seam/taglib"
 |   xmlns="http://www.w3.org/1999/xhtml">
 | <head>
 | <title>Person</title>
 | </head>
 | <body>
 | <ui:composition xmlns:rich="http://richfaces.ajax4jsf.org/rich"
 |   template="person.xhtml">
 |   <ui:define name="tab">
 |
 |     <div name="tabset-actions" />
 |     <div name="tabset-links">
 |     <ul class="tabset" />
 |     </div>
 |     <div class="tab"><ui:insert name="tab" /></div>
 |
 |     <h:outputLabel value="Title" for="title" />
 |     <h:inputText id="title" value="#{person.title}" />
 |     <h:outputLabel value="Last Name" for="lastName" />
 |     <h:inputText id="lastName" value="#{person.lastName}" />
 |
 |     <h:outputLabel value="Date of Birth" for="dateOfBirth" />
 |     <h:inputText id="dateOfBirth" value="#{person.dateOfBirth}" />
 |     <h:outputLabel value="Preferred Language" for="preferredLanguage" />
 |     <h:inputText id="preferredLanguage"
 |       value="#{person.preferredLanguage}" />
 |
 |
 |   </ui:define>
 | </ui:composition>
 | </body>
 | </html>
 |
 |


 | <?xml version="1.0" encoding="UTF-8 (See http://UTF-8.ora-code.com)"?>
 | <!DOCTYPE html
 |   PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR
/xhtml1/DTD/xhtml1-transitional.dtd">
 | <html xmlns:f="http://java.sun.com/jsf/core"
 |   xmlns:h="http://java.sun.com/jsf/html"
 |   xmlns:ui="http://java.sun.com/jsf/facelets"
 |   xmlns:s="http://jboss.com/products/seam/taglib"
 |   xmlns="http://www.w3.org/1999/xhtml">
 | <head>
 | <title>Person</title>
 | </head>
 | <body>
 | <ui:composition xmlns:rich="http://richfaces.ajax4jsf.org/rich"
 |   template="/layout/template.xhtml">
 |   <ui:define name="body">
 |     <h:form id="form">
 |
 |
 |       <div name="tabset-actions"><s:button value="Save"
 |         action="#{personEditor.save}" /></div>
 |       <div name="tabset-links">
 |       <ul class="tabset">
 |         <li><h:commandLink id="identity" value="Identity2"
 |           action="#{personEditor.enterIdentity}" /> <s:link value="Identity"
 |           action="#{personEditor.enterIdentity}" /></li>
 |         <li><h:commandLink id="banking" value="Banking2"
 |           action="#{personEditor.enterBanking}" /> <s:link value="Banking"
 |           action="#{personEditor.enterBanking}" /></li>
 |       </ul>
 |       </div>
 |       <div class="tab"><ui:insert name="tab" /></div>
 |
 |     </h:form>
 |   </ui:define>
 | </ui:composition>
 | </body>
 | </html>
 |
 | [img][/img]

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

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

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