[jboss-user] [JBoss Seam] - Double Click . Seam 1.2.1.GA

lilianas do-not-reply at jboss.com
Mon Aug 6 22:08:12 EDT 2007


Hi:
I got one particular Next button on the screen which when I click the Next button twice, I encountered the following exception.  Note that this Next button performs a number of validation steps before it renders the next screen.  Some other buttons which perform only 1 step validation does not have this problem. I suspect the slow render process is causing the problem. This is the exception:  

javax.faces.el.EvaluationException: /normal-application.jspx @13,72 rendered="#{normalCreditApplication.serviceProvider}": Exception getting value of property serviceProvider of base of type : com.yoogalu.ncf.web.seam.bean.NormalCreditApplication_$$_javassist_2
		at com.sun.facelets.el.LegacyValueBinding.getValue(LegacyValueBinding.java:60)
:
:
:
Caused by: org.jboss.seam.NoConversationException: no long-running conversation for @Conversational bean: normalCreditApplication
	at org.jboss.seam.interceptors.ConversationalInterceptor.aroundInvoke(ConversationalInterceptor.java:55)


The Next button is defined in the page (.xhmtl) as follow:

<h:form id='normalApp'>
	:
	:
	<h:commandButton value="#{msg['creditApplication.next']}"
			action="next" styleClass="buttom" />

</h:form>

In the page flow (pageflow.jpdl.xml), the transition for Next is defined as follow.  It goes through valideLocation, validaInvoiceNo, validateSecondApplicant, validaDefaultPrintPrivacy,  normalSerialNumberPrint:

  | 	<page name="normal" view-id="/normal-application.jspx"
  | 		back="disabled">
  | 		<redirect />
  | 	<transition name="next" 
  | to="validateLocation"></transition>
  | 	</page>
  | 
  | 	<decision name="validateLocation"
  | 		expression="#{normalCreditApplication.validateLocation}">
  | 	<transition name="true" 
  | 	to="validaInvoiceNo"></transition>
  | 		<transition name="false" to="normal"></transition>
  | 	</decision>
  | 
  | 	<decision name="validaInvoiceNo"
  | 		expression="#{normalCreditApplication.validaInvoiceNo}">
  | 		<transition name="true" 
  | 			to="validateSecondApplicant">
  | </transition>
  | 		<transition name="false" to="normal"></transition>
  | 	</decision>
  | 
  | 	<decision name="validateSecondApplicant"
  | 		expression="#{normalCreditApplication.validateSecondApplicant}">
  | 		<transition name="true" to="validaDefaultPrintPrivacy"></transition>
  | 		<transition name="false" to="normal"></transition>
  | 	</decision>
  | 
  | 		<decision name="validaDefaultPrintPrivacy"
  | 		expression="#{normalCreditApplication.validaDefaultPrintPrivacy}">
  | 		<transition name="true" to="normalSerialNumberPrint">
  | 			<action
  | 				expression="#{normalCreditApplication.calculateSerialNumber}" />
  | 			<action expression="#{normalCreditApplication.setMapPrint}" />
  | 		</transition>
  | 		<transition name="false" to="normalListPossibleDebtors">
  | 		</transition>
  | 	</decision>
  | 
  | 	<page name="normalSerialNumberPrint"
  | 		view-id="/normal-serialnumber-print.jspx" back="enabled">
  | 		<redirect />
  | 		<transition name="previous" to="normal">
  | 			<action
  | 				expression="#{normalCreditApplication.setNoPrinting}" />
  | 		</transition>
  | 		<transition name="next" to="validaSerialNumber">
  | 			<action expression="#{normalCreditApplication.setPrinting}" />
  | 		</transition>
  | 	</page>
  | 
  | 
  | Many Thanks
  | 
  | 
  |   | 
  |   | anonymous wrote : 
  |   |   | 
  |   |   | 
  |   |   | My page:
  |   |   | 
  |   |   |   | (It is the template) ... Here have the code that is broken when i press a lot of time the next buttom
  |   |   |   | ***
  |   |   |   | <h:panelGroup rendered="#{!normalCreditApplication.serviceProvider}">
  |   |   |   | **
  |   |   |   | 
  |   |   |   | <?xml version="1.0" encoding="UTF-8"?>
  |   |   |   | <jsp:root	xmlns="http://www.w3.org/1999/xhtml"
  |   |   |   | 			xmlns:jsp="http://java.sun.com/JSP/Page"
  |   |   |   | 			xmlns:ui="http://java.sun.com/jsf/facelets"
  |   |   |   | 			xmlns:h="http://java.sun.com/jsf/html"
  |   |   |   | 			version="2.0">
  |   |   |   | 		
  |   |   |   | 		<ui:composition template="/WEB-INF/view/layout/default.jspx">
  |   |   |   | 		<ui:define name="body-content">
  |   |   |   | 			<ui:include src="/WEB-INF/view/body-content/normal-application.jspx"/>
  |   |   |   | 		</ui:define>
  |   |   |   | 		<ui:define name="title">
  |   |   |   | 			
  |   |   |   | 			<h:panelGroup rendered="#{normalCreditApplication.serviceProvider}">
  |   |   |   | 				<h:outputText value="#{msg['createServProvApplication-title']}" styleClass="page_title" />
  |   |   |   | 			</h:panelGroup>	
  |   |   |   | 			<h:panelGroup rendered="#{!normalCreditApplication.serviceProvider}">
  |   |   |   | 				<h:outputText value="#{msg['createStandardApplication-title']}" styleClass="page_title" />
  |   |   |   | 			</h:panelGroup>	
  |   |   |   | 		</ui:define>
  |   |   |   | 		<ui:define name="description">
  |   |   |   | 				<h:outputText value="#{msg['normalApplication-description']}"  />
  |   |   |   | 		</ui:define>
  |   |   |   | 	
  |   |   |   | 		<ui:define name="load-index">
  |   |   |   | 		</ui:define>
  |   |   |   | 	</ui:composition>
  |   |   |   | </jsp:root>
  |   |   |   | 
  |   |   |   | (It is the body)
  |   |   |   | 
  |   |   |   | <?xml version="1.0" encoding="UTF-8"?>
  |   |   |   | <jsp:root xmlns="http://www.w3.org/1999/xhtml"
  |   |   |   | 	xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
  |   |   |   | 	xmlns:a="https://ajax4jsf.dev.java.net/ajax"
  |   |   |   | 	xmlns:c="http://java.sun.com/jstl/core"
  |   |   |   | 	xmlns:f="http://java.sun.com/jsf/core"
  |   |   |   | 	xmlns:h="http://java.sun.com/jsf/html"
  |   |   |   | 	xmlns:jsp="http://java.sun.com/JSP/Page"
  |   |   |   | 	xmlns:rich="http://richfaces.ajax4jsf.org/rich"
  |   |   |   | 	xmlns:s="http://jboss.com/products/seam/taglib"
  |   |   |   | 	xmlns:ui="http://java.sun.com/jsf/facelets" version="2.0">
  |   |   |   | 	<h:messages globalOnly="true" styleClass="alertMsgBold" />
  |   |   |   | 	<div><h:form id='normalApp'>
  |   |   |   | 
  |   |   |   | 
  |   |   |   | 		<s:validateAll>
  |   |   |   | 
  |   |   |   | 
  |   |   |   | 			<a4j:region id="autocomplete">
  |   |   |   | 
  |   |   |   | 				<table width="610" border="0">
  |   |   |   | 					<tr>
  |   |   |   | 						<td colspan="4"><h:outputText id="idHeaderLocation"
  |   |   |   | 							value="#{msg['creditApplication.headerLocation']}"
  |   |   |   | 							styleClass="header1" /></td>
  |   |   |   | 					</tr>
  |   |   |   | 
  |   |   |   | 					<c:if test="#{userCredentials.allStoresAccessor}">
  |   |   |   | 
  |   |   |   | 						<tr>
  |   |   |   | 							<td width="10"><img src="images/point.gif" /></td>
  |   |   |   | 							<td width="100"><h:outputText for="company"
  |   |   |   | 								value="#{msg['creditApplication.company']}" /></td>
  |   |   |   | 							<td width="300"><a4j:outputPanel id="companyPanel">
  |   |   |   | 								<a4j:region id="companyRegion" renderRegionOnly="false">
  |   |   |   | 									<h:inputText
  |   |   |   | 										value="#{normalCreditApplication.autoCompleteLocation.companySel}"
  |   |   |   | 										size="50" required="true" id="company" />
  |   |   |   | 
  |   |   |   | 									<rich:suggestionbox for="company"
  |   |   |   | 										suggestionAction="#{normalCreditApplication.autoCompleteLocation.autocompleteCompany}"
  |   |   |   | 										var="company" height="200" width="250" requestDelay="350"
  |   |   |   | 										focus="store" ignoreDupResponses="true">
  |   |   |   | 										<a4j:support event="onselect"
  |   |   |   | 											action="#{normalCreditApplication.autoCompleteLocation.onSelectCompany}"
  |   |   |   | 											reRender="storePanel,dealerPanel"
  |   |   |   | 											oncomplete="setFocus('normalApp:store');" />
  |   |   |   | 										<h:column>
  |   |   |   | 											<h:outputText value="#{company.companyCode}-#{company.name}" />
  |   |   |   | 										</h:column>
  |   |   |   | 									</rich:suggestionbox>
  |   |   |   | 								</a4j:region>
  |   |   |   | 							</a4j:outputPanel></td>
  |   |   |   | 							<td width="200"><a4j:outputPanel ajaxRendered="true">
  |   |   |   | 								<h:message for="company" styleClass="alertMsg" />
  |   |   |   | 							</a4j:outputPanel></td>
  |   |   |   | 						</tr>
  |   |   |   | 					</c:if>
  |   |   |   | 					<c:if test="#{!userCredentials.allStoresAccessor}">
  |   |   |   | 						<tr>
  |   |   |   | 							<td width="10"><img src="images/point.gif" /></td>
  |   |   |   | 							<td width="100"><h:outputText for="company"
  |   |   |   | 								value="#{msg['creditApplication.company']}" /></td>
  |   |   |   | 							<td width="300"><h:outputText for="company"
  |   |   |   | 								value="#{normalCreditApplication.autoCompleteLocation.companySel}" />
  |   |   |   | 							</td>
  |   |   |   | 							<td width="200"></td>
  |   |   |   | 						</tr>
  |   |   |   | 					</c:if>
  |   |   |   | 					<c:if test="#{userCredentials.allStoresAccessor}">
  |   |   |   | 						<tr>
  |   |   |   | 							<td><img src="images/point.gif" /></td>
  |   |   |   | 							<td><h:outputText for="store"
  |   |   |   | 								value="#{msg['creditApplication.store']}" /></td>
  |   |   |   | 							<td><a4j:outputPanel id="storePanel">
  |   |   |   | 								<a4j:region id="storeRegion" renderRegionOnly="false">
  |   |   |   | 									<h:inputText
  |   |   |   | 										value="#{normalCreditApplication.autoCompleteLocation.storeSel}"
  |   |   |   | 										size="50" required="true" id="store" />
  |   |   |   | 									<rich:suggestionbox for="store" requestDelay="350"
  |   |   |   | 										suggestionAction="#{normalCreditApplication.autoCompleteLocation.autocompleteStore}"
  |   |   |   | 										var="store" height="200" width="250" focus="dealer">
  |   |   |   | 										<a4j:support event="onselect"
  |   |   |   | 											action="#{normalCreditApplication.autoCompleteLocation.onSelectStore}"
  |   |   |   | 											reRender="dealerPanel"
  |   |   |   | 											oncomplete="setFocus('normalApp:dealer');" />
  |   |   |   | 										<h:column>
  |   |   |   | 											<h:outputText value="#{store.storeCode}-#{store.name}" />
  |   |   |   | 										</h:column>
  |   |   |   | 									</rich:suggestionbox>
  |   |   |   | 								</a4j:region>
  |   |   |   | 							</a4j:outputPanel></td>
  |   |   |   | 							<td><a4j:outputPanel ajaxRendered="true">
  |   |   |   | 								<h:message for="store" styleClass="alertMsg" />
  |   |   |   | 							</a4j:outputPanel></td>
  |   |   |   | 						</tr>
  |   |   |   | 					</c:if>
  |   |   |   | 					<c:if test="#{!userCredentials.allStoresAccessor}">
  |   |   |   | 						<tr>
  |   |   |   | 							<td><img src="images/point.gif" /></td>
  |   |   |   | 							<td><h:outputText for="store"
  |   |   |   | 								value="#{msg['creditApplication.store']}" /></td>
  |   |   |   | 							<td><h:outputText for="store"
  |   |   |   | 								value="#{normalCreditApplication.autoCompleteLocation.storeSel}" />
  |   |   |   | 							</td>
  |   |   |   | 							<td></td>
  |   |   |   | 						</tr>
  |   |   |   | 					</c:if>
  |   |   |   | 					<tr>
  |   |   |   | 						<td><img src="images/point.gif" /></td>
  |   |   |   | 						<td><h:outputText for="dealer"
  |   |   |   | 							value="#{msg['creditApplication.dealer']}" /></td>
  |   |   |   | 						<td><a4j:outputPanel id="dealerPanel">
  |   |   |   | 
  |   |   |   | 							<h:inputText
  |   |   |   | 								value="#{normalCreditApplication.autoCompleteLocation.dealerSel}"
  |   |   |   | 								size="50" id="dealer" required="true" />
  |   |   |   | 							<rich:suggestionbox for="dealer" requestDelay="350"
  |   |   |   | 								suggestionAction="#{normalCreditApplication.autoCompleteLocation.autocompleteDealer}"
  |   |   |   | 								var="dealer" height="200" width="250">
  |   |   |   | 								<a4j:support event="onselect"
  |   |   |   | 									oncomplete="setFocus('normalApp:invoice');" />
  |   |   |   | 								<h:column>
  |   |   |   | 									<h:outputText
  |   |   |   | 										value="#{dealer.departmentCode}-#{dealer.franchiseName}" />
  |   |   |   | 								</h:column>
  |   |   |   | 							</rich:suggestionbox>
  |   |   |   | 
  |   |   |   | 						</a4j:outputPanel></td>
  |   |   |   | 						<td><a4j:outputPanel ajaxRendered="true">
  |   |   |   | 							<h:message for="dealer" styleClass="alertMsg" />
  |   |   |   | 						</a4j:outputPanel></td>
  |   |   |   | 					</tr>
  |   |   |   | 				</table>
  |   |   |   | 			</a4j:region>
  |   |   |   | 			<table width="560">
  |   |   |   | 				<tr>
  |   |   |   | 					<td colspan="4" height="10"></td>
  |   |   |   | 				</tr>
  |   |   |   | 				<tr>
  |   |   |   | 					<td colspan="4"><h:outputText id="headerApplicationDetails"
  |   |   |   | 						value="#{msg['creditApplication.headerApplicationDetails']}"
  |   |   |   | 						styleClass="header1" /></td>
  |   |   |   | 				</tr>
  |   |   |   | 				<tr>
  |   |   |   | 					<td width="10"><img src="images/point.gif" /></td>
  |   |   |   | 					<td width="100"><h:outputText for="invoice"
  |   |   |   | 						value="#{msg['creditApplication.invoice']}" /></td>
  |   |   |   | 					<td width="150"><h:inputText id="invoice"
  |   |   |   | 						value="#{normalCreditApplication.application.primaryInvoice.invoiceNo}"
  |   |   |   | 						required="true"></h:inputText></td>
  |   |   |   | 					<td width="300"><h:message for="invoice" styleClass="alertMsg" /></td>
  |   |   |   | 				</tr>
  |   |   |   | 				<tr>
  |   |   |   | 					<td colspan="4" height="10"></td>
  |   |   |   | 				</tr>
  |   |   |   | 				<tr>
  |   |   |   | 					<td colspan="4"><h:outputText for="headerFirstApplicant"
  |   |   |   | 						value="#{msg['creditApplication.headerFirstApplicant']}"
  |   |   |   | 						styleClass="header1" /></td>
  |   |   |   | 				</tr>
  |   |   |   | 				<tr>
  |   |   |   | 					<td><img src="images/point.gif" /></td>
  |   |   |   | 					<td><h:outputText for="firstName"
  |   |   |   | 						value="#{msg['creditApplication.firstName']}" /></td>
  |   |   |   | 					<td><h:inputText id="firstName"
  |   |   |   | 						value="#{normalCreditApplication.application.applicant1.customer.firstName}"
  |   |   |   | 						required="true"></h:inputText></td>
  |   |   |   | 					<td><h:message for="firstName" styleClass="alertMsg" /></td>
  |   |   |   | 				</tr>
  |   |   |   | 				<tr>
  |   |   |   | 					<td><img src="images/point.gif" /></td>
  |   |   |   | 					<td><h:outputText for="middleName"
  |   |   |   | 						value="#{msg['creditApplication.middleName']}" /></td>
  |   |   |   | 					<td><h:inputText id="middleName"
  |   |   |   | 						value="#{normalCreditApplication.application.applicant1.customer.middleName}"></h:inputText></td>
  |   |   |   | 					<td><h:message for="middleName" styleClass="alertMsg" /></td>
  |   |   |   | 				</tr>
  |   |   |   | 				<tr>
  |   |   |   | 					<td><img src="images/point.gif" /></td>
  |   |   |   | 					<td><h:outputText for="surname"
  |   |   |   | 						value="#{msg['creditApplication.surname']}" /></td>
  |   |   |   | 					<td><h:inputText id="surname"
  |   |   |   | 						value="#{normalCreditApplication.application.applicant1.customer.surname}"
  |   |   |   | 						required="true"></h:inputText></td>
  |   |   |   | 					<td><h:message for="surname" styleClass="alertMsg" /></td>
  |   |   |   | 				</tr>
  |   |   |   | 				<tr>
  |   |   |   | 					<td colspan="4" height="10"></td>
  |   |   |   | 				</tr>
  |   |   |   | 				<tr>
  |   |   |   | 					<td colspan="4"><h:outputText for="headerSecondApplicant"
  |   |   |   | 						value="#{msg['creditApplication.headerSecondApplicant']}"
  |   |   |   | 						styleClass="header1" /></td>
  |   |   |   | 				</tr>
  |   |   |   | 				<tr>
  |   |   |   | 					<td><img src="images/point.gif" /></td>
  |   |   |   | 					<td><h:outputText for="firstNameSecond"
  |   |   |   | 						value="#{msg['creditApplication.firstName']}" /></td>
  |   |   |   | 					<td><h:inputText id="firstNameSecond"
  |   |   |   | 						value="#{normalCreditApplication.application.applicant2.customer.firstName}"></h:inputText></td>
  |   |   |   | 					<td><h:message for="firstNameSecond" styleClass="alertMsg" /></td>
  |   |   |   | 				</tr>
  |   |   |   | 				<tr>
  |   |   |   | 					<td><img src="images/point.gif" /></td>
  |   |   |   | 					<td><h:outputText for="middleNameSecond"
  |   |   |   | 						value="#{msg['creditApplication.middleName']}" /></td>
  |   |   |   | 					<td><h:inputText id="middleNameSecond"
  |   |   |   | 						value="#{normalCreditApplication.application.applicant2.customer.middleName}"></h:inputText></td>
  |   |   |   | 					<td><h:message for="middleNameSecond" styleClass="alertMsg" /></td>
  |   |   |   | 				</tr>
  |   |   |   | 				<tr>
  |   |   |   | 					<td><img src="images/point.gif" /></td>
  |   |   |   | 					<td><h:outputLabel for="surnameSecond"
  |   |   |   | 						value="#{msg['creditApplication.surname']}" /></td>
  |   |   |   | 					<td><h:inputText id="surnameSecond"
  |   |   |   | 						value="#{normalCreditApplication.application.applicant2.customer.surname}"></h:inputText></td>
  |   |   |   | 					<td><h:message for="surnameSecond" styleClass="alertMsg" /></td>
  |   |   |   | 				</tr>
  |   |   |   | 			</table>
  |   |   |   | 
  |   |   |   | 			<f:subview rendered="#{normalCreditApplication.serviceProvider}">
  |   |   |   | 
  |   |   |   | 
  |   |   |   | 
  |   |   |   | 				<table width="560" border="0">
  |   |   |   | 					<tr>
  |   |   |   | 						<td colspan="4"><h:outputText id="headerServiceProvider"
  |   |   |   | 							value="#{msg['creditApplication.headerServiceProvider']}"
  |   |   |   | 							styleClass="header1" /></td>
  |   |   |   | 					</tr>
  |   |   |   | 
  |   |   |   | 					<tr>
  |   |   |   | 						<td width="10"><img src="images/point.gif" /></td>
  |   |   |   | 						<td width="100"><h:outputLabel for="serviceProv"
  |   |   |   | 							value="#{msg['creditApplication.serviceProvider']}" /></td>
  |   |   |   | 						<td width="400"><h:selectOneMenu
  |   |   |   | 							value="#{normalCreditApplication.application.serviceProvider}"
  |   |   |   | 							style="width:280px"
  |   |   |   | 							valueChangeListener="#{normalCreditApplication.onSelectServiceProvider}"
  |   |   |   | 							id="serviceProviderId">
  |   |   |   | 							<s:selectItems
  |   |   |   | 								value="#{normalCreditApplication.listServiceProviders}"
  |   |   |   | 								var="serviceProvider" onchange="submit()" immediate="true"
  |   |   |   | 								label="#{serviceProvider.name}" />
  |   |   |   | 							<f:converter converterId="serviceProviderConverter" />
  |   |   |   | 						</h:selectOneMenu></td>
  |   |   |   | 						<td width="50"><h:message for="serviceProv"
  |   |   |   | 							styleClass="alertMsg" /></td>
  |   |   |   | 					</tr>
  |   |   |   | 
  |   |   |   | 				</table>
  |   |   |   | 			</f:subview>
  |   |   |   | 
  |   |   |   | 		</s:validateAll>
  |   |   |   | 		<h:commandButton value="#{msg['creditApplication.next']}"
  |   |   |   | 			action="next" styleClass="buttom" />
  |   |   |   | 	</h:form> <br />
  |   |   |   | 	<br />
  |   |   |   | 	</div>
  |   |   |   | <script type="text/javascript">
  |   |   |   | 
  |   |   |   | 
  |   |   |   | 
  |   |   |   | 	function setFocus(parm) {
  |   |   |   | 		document.getElementById(parm).focus();
  |   |   |   | 	}
  |   |   |   | 
  |   |   |   | </script>
  |   |   |   | 	
  |   |   |   | 
  |   |   |   | </jsp:root>
  |   |   |   | 
  |   |   | My Bean
  |   |   | 
  |   |   |   | package com.yoogalu.ncf.web.seam.bean;
  |   |   |   | 
  |   |   |   | import java.io.Serializable;
  |   |   |   | import java.sql.Timestamp;
  |   |   |   | import java.util.HashMap;
  |   |   |   | import java.util.List;
  |   |   |   | import java.util.Map;
  |   |   |   | import javax.faces.event.ValueChangeEvent;
  |   |   |   | import org.jboss.seam.ScopeType;
  |   |   |   | import org.jboss.seam.annotations.Begin;
  |   |   |   | import org.jboss.seam.annotations.Conversational;
  |   |   |   | import org.jboss.seam.annotations.In;
  |   |   |   | import org.jboss.seam.annotations.Name;
  |   |   |   | import org.jboss.seam.annotations.Out;
  |   |   |   | import org.jboss.seam.annotations.Scope;
  |   |   |   | import org.jboss.seam.annotations.datamodel.DataModel;
  |   |   |   | import org.jboss.seam.annotations.datamodel.DataModelSelection;
  |   |   |   | import org.jboss.seam.core.FacesMessages;
  |   |   |   | 
  |   |   |   | import com.yoogalu.framework.FrameworkConstants;
  |   |   |   | import com.yoogalu.ncf.core.cache.CompanyCache;
  |   |   |   | import com.yoogalu.ncf.core.cache.DealerCache;
  |   |   |   | import com.yoogalu.ncf.core.cache.ServiceProviderCache;
  |   |   |   | import com.yoogalu.ncf.core.cache.StoreCache;
  |   |   |   | import com.yoogalu.ncf.core.entity.AppCustomer;
  |   |   |   | import com.yoogalu.ncf.core.entity.Application;
  |   |   |   | import com.yoogalu.ncf.core.entity.Company;
  |   |   |   | import com.yoogalu.ncf.core.entity.Customer;
  |   |   |   | import com.yoogalu.ncf.core.entity.Dealer;
  |   |   |   | import com.yoogalu.ncf.core.entity.Invoice;
  |   |   |   | import com.yoogalu.ncf.core.entity.ServiceProvider;
  |   |   |   | import com.yoogalu.ncf.core.entity.Store;
  |   |   |   | import com.yoogalu.ncf.core.util.AppContext;
  |   |   |   | import com.yoogalu.ncf.web.seam.Tokens;
  |   |   |   | import com.yoogalu.ncf.web.seam.Util;
  |   |   |   | import com.yoogalu.ncf.web.seam.bean.UserCredentials;
  |   |   |   | 
  |   |   |   | @Name("normalCreditApplication")
  |   |   |   | @Scope(ScopeType.CONVERSATION)
  |   |   |   | @Conversational
  |   |   |   | public class NormalCreditApplication implements Serializable {
  |   |   |   | 
  |   |   |   |     private static final long serialVersionUID = FrameworkConstants.SERIAL_VERSION_UID;
  |   |   |   | 
  |   |   |   |     private static final int MAX_SERIAL = 999;
  |   |   |   | 
  |   |   |   |     private static final String APPLICATIONREF = "applicationRef";
  |   |   |   | 
  |   |   |   |     private static final String APPLICANTNAME1 = "applicantName1";
  |   |   |   | 
  |   |   |   |     private static final String APPLICANTNAME2 = "applicantName2";
  |   |   |   | 
  |   |   |   |     private static final String SERIALNO = "serialNo";
  |   |   |   | 
  |   |   |   |     private static final String DEALERNAME = "dealerName";
  |   |   |   | 
  |   |   |   |     private static final String APPFEE = "appFee";
  |   |   |   | 
  |   |   |   |     private static final String APPSTATUS_NEWAPPLICATION = "N";
  |   |   |   | 
  |   |   |   |     private static final String NAMETEMPLATE = "template";
  |   |   |   | 
  |   |   |   |     private static final String PRIVACY = "privacy";
  |   |   |   | 
  |   |   |   |     private static final String ONE = "One";
  |   |   |   | 
  |   |   |   |     private static final String TWO = "Two";
  |   |   |   | 
  |   |   |   |     private static final String APPLICATIONFEE = "applicationFee";
  |   |   |   | 
  |   |   |   |     private static final String NAMEFIELD1VALUE = "________________________________";
  |   |   |   | 
  |   |   |   |     private static final String DATEFIELD1VALUE = "___/___/_____";
  |   |   |   | 
  |   |   |   |     private static final String DATETEXT1VALUE = "Date";
  |   |   |   | 
  |   |   |   |     private static final String NAMEFIELD1 = "nameField1";
  |   |   |   | 
  |   |   |   |     private static final String DATEFIELD1 = "dateField1";
  |   |   |   | 
  |   |   |   |     private static final String DATETEXT1 = "dateText1";
  |   |   |   | 
  |   |   |   |     private static final String NAMEFIELD2 = "nameField2";
  |   |   |   | 
  |   |   |   |     private static final String DATEFIELD2 = "dateField2";
  |   |   |   | 
  |   |   |   |     private static final String DATETEXT2 = "dateText2";
  |   |   |   | 
  |   |   |   |     private Dealer dealer;
  |   |   |   | 
  |   |   |   |     private String surnameSearch;
  |   |   |   | 
  |   |   |   |     private String firstNameSearch;
  |   |   |   | 
  |   |   |   | 
  |   |   |   |     private String serialNumberUser;
  |   |   |   | 
  |   |   |   |     private List<Customer> listPossibleDebtors;
  |   |   |   | 
  |   |   |   |     private boolean serviceProvider;
  |   |   |   | 
  |   |   |   |     private boolean secondApplicant;
  |   |   |   | 
  |   |   |   |     private String idServiceProvider;
  |   |   |   | 
  |   |   |   |     private String companyName;
  |   |   |   | 
  |   |   |   |     private String storeName;
  |   |   |   | 
  |   |   |   |     private String dealerName;
  |   |   |   |     
  |   |   |   |     private Integer numRows;
  |   |   |   |     private boolean flgPrint;
  |   |   |   |     private AutoCompleteLocation autoCompleteLocation ;
  |   |   |   |     @Out(value = Tokens.entityLookup4Application, scope = ScopeType.CONVERSATION)
  |   |   |   |     private Application application;
  |   |   |   | 
  |   |   |   |     @Out(value = "mapPrint", scope = ScopeType.CONVERSATION, required = false)
  |   |   |   |     private transient Map<String, String> mapPrint;
  |   |   |   | 
  |   |   |   |     @In(value = Tokens.bean4UserCredentials, scope = ScopeType.SESSION)
  |   |   |   |     private transient UserCredentials userCredentials;
  |   |   |   | 
  |   |   |   |     @DataModelSelection(value = "listPossibleDebtors")
  |   |   |   |     private Customer customerSelected;
  |   |   |   | 
  |   |   |   |     @In
  |   |   |   |     private FacesMessages facesMessages;
  |   |   |   | 
  |   |   |   |     @Begin(join = true, pageflow = "normalCreditApplicationFlow")
  |   |   |   |     public void beginStandard() {
  |   |   |   |         System.out.println("**********Standars**********");
  |   |   |   |         initApplication();
  |   |   |   | 
  |   |   |   |     }
  |   |   |   | 
  |   |   |   |     @Begin(join = true, pageflow = "normalCreditApplicationFlow")
  |   |   |   |     public void beginServProv() {
  |   |   |   |         System.out.print("**********ServProv***********");
  |   |   |   |         initApplication();
  |   |   |   |         setServiceProvider(true);
  |   |   |   | 
  |   |   |   |         String serviceProviderContractType = Util.getBundledMessageResource(Tokens.SERVICEPROVIDERCONTRACTTYPE);
  |   |   |   |         getApplication().setContractTypeCode(serviceProviderContractType);
  |   |   |   | 
  |   |   |   |     }
  |   |   |   | 
  |   |   |   |     private void initApplication() {
  |   |   |   |         this.autoCompleteLocation = new AutoCompleteLocation(); 
  |   |   |   |         
  |   |   |   |         this.application = new Application();
  |   |   |   |         this.application.setApplicationDate(new Timestamp(System.currentTimeMillis()));
  |   |   |   |         this.application.setAppStatus(APPSTATUS_NEWAPPLICATION);
  |   |   |   |         Customer firstCustomer = new Customer();
  |   |   |   |         Customer secondCustomer = new Customer();
  |   |   |   |         AppCustomer firstAppCustomer = new AppCustomer();
  |   |   |   |         AppCustomer secondAppCustomer = new AppCustomer();
  |   |   |   |         Invoice invoice = new Invoice();
  |   |   |   |         firstAppCustomer.setCustomer(firstCustomer);
  |   |   |   |         firstAppCustomer.setApplicantNo(new Integer(1));
  |   |   |   | 
  |   |   |   |         secondAppCustomer.setCustomer(secondCustomer);
  |   |   |   |         secondAppCustomer.setApplicantNo(new Integer(2));
  |   |   |   |         this.application.setPrimaryInvoice(invoice);
  |   |   |   |         this.application.setApplicant1(firstAppCustomer);
  |   |   |   |         this.application.setApplicant2(secondAppCustomer);
  |   |   |   | 
  |   |   |   |         if (!userCredentials.isAllStoresAccessor()) {
  |   |   |   | 
  |   |   |   |             this.autoCompleteLocation.setStoreSel(Util.getStoreCodeDashStoreName(userCredentials.getStoreId()));
  |   |   |   |             this.autoCompleteLocation.setCompanySel(Util.getCompanyCodeDashStoreName(userCredentials.getCompanyId()));
  |   |   |   |         }
  |   |   |   |     }
  |   |   |   | 
  |   |   |   |     public void searchPossibleDebtorsbyUser() {
  |   |   |   |         final List<Customer> customers;
  |   |   |   |         customers = Util.getApplicationService().searchCustomerByName(getFirstNameSearch(), getSurnameSearch());
  |   |   |   |         setListPossibleDebtors(customers);
  |   |   |   |         this.numRows = customers.size();
  |   |   |   |     }
  |   |   |   | 
  |   |   |   |     public void searchPossibleDebtorsbySystem() {
  |   |   |   |         final List<Customer> customers;
  |   |   |   |         customers = Util.getApplicationService().searchCustomerByName(
  |   |   |   |                 this.getApplication().getApplicant1().getCustomer().getFirstName(),
  |   |   |   |                 this.getApplication().getApplicant1().getCustomer().getSurname());
  |   |   |   |         setFirstNameSearch(this.getApplication().getApplicant1().getCustomer().getFirstName());
  |   |   |   |         setSurnameSearch(this.getApplication().getApplicant1().getCustomer().getSurname());
  |   |   |   |         setListPossibleDebtors(customers);
  |   |   |   |         this.numRows = customers.size();
  |   |   |   |     }
  |   |   |   | 
  |   |   |   |     public void setMapPrint() {
  |   |   |   | 
  |   |   |   |         String nameFile = null;
  |   |   |   |         String applicationFee = null;
  |   |   |   |         String valueApplicationFee = null;
  |   |   |   |         String filePath = null;
  |   |   |   |         mapPrint = new HashMap<String, String>();
  |   |   |   |         // Obtain the name of the pdf template
  |   |   |   | 
  |   |   |   |         if (isSecondApplicant()) {
  |   |   |   |             nameFile = PRIVACY + TWO;
  |   |   |   | 
  |   |   |   |         } else {
  |   |   |   |             nameFile = PRIVACY + ONE;
  |   |   |   |         }
  |   |   |   |         if (getApplication().getContractTypeCode() != null) {
  |   |   |   |             nameFile = nameFile + getApplication().getContractTypeCode().toUpperCase();
  |   |   |   |         }
  |   |   |   | 
  |   |   |   |         try {
  |   |   |   |             filePath = Util.getBundledMessageResource(nameFile);
  |   |   |   |         } catch (Exception e) {
  |   |   |   |             filePath = null;
  |   |   |   |         }
  |   |   |   | 
  |   |   |   |         if (filePath == null) {
  |   |   |   |             if (getApplication().getContractTypeCode() != null) {
  |   |   |   |                 nameFile = PRIVACY + getApplication().getContractTypeCode().toUpperCase();
  |   |   |   |             }
  |   |   |   |             try {
  |   |   |   |                 filePath = Util.getBundledMessageResource(nameFile);
  |   |   |   |             } catch (Exception e) {
  |   |   |   |                 filePath = null;
  |   |   |   |             }
  |   |   |   |         }
  |   |   |   |         // Obtain the value of applicationFee
  |   |   |   | 
  |   |   |   |         if (getApplication().getContractTypeCode() != null) {
  |   |   |   |             applicationFee = APPLICATIONFEE + getApplication().getContractTypeCode().toUpperCase();
  |   |   |   | 
  |   |   |   |         }
  |   |   |   |         try {
  |   |   |   |             valueApplicationFee = Util.getBundledMessageResource(applicationFee);
  |   |   |   |         } catch (Exception e) {
  |   |   |   |             valueApplicationFee = null;
  |   |   |   |         }
  |   |   |   |         if (valueApplicationFee == null) {
  |   |   |   |             try {
  |   |   |   |                 valueApplicationFee = Util.getBundledMessageResource(APPLICATIONFEE);
  |   |   |   |             } catch (Exception e) {
  |   |   |   |                 valueApplicationFee = null;
  |   |   |   |             }
  |   |   |   |         }
  |   |   |   | 
  |   |   |   |         // Set the map to print
  |   |   |   |         this.mapPrint.put(APPLICATIONREF, this.getDealer().getFranchiseCode() + Tokens.SPACE + Tokens.DASH + Tokens.SPACE
  |   |   |   |                 + getApplication().getPrimaryInvoice().getInvoiceNo().toString());
  |   |   |   |         this.mapPrint.put(APPLICANTNAME1, getApplication().getApplicant1().getCustomer().getFullName());
  |   |   |   |         this.mapPrint.put(APPLICANTNAME2, getApplication().getApplicant2().getCustomer().getFullName());
  |   |   |   |         this.mapPrint.put(SERIALNO, getApplication().getSerialNo());
  |   |   |   | 
  |   |   |   |         this.mapPrint.put(APPFEE, valueApplicationFee);
  |   |   |   |         this.mapPrint.put(NAMETEMPLATE, filePath);
  |   |   |   | 
  |   |   |   | 
  |   |   |   |         if (serviceProvider) {
  |   |   |   | 
  |   |   |   |             String nameField2 = Tokens.SPACE;
  |   |   |   |             String dateField2 = Tokens.SPACE;
  |   |   |   |             String dateText2 = Tokens.SPACE;
  |   |   |   | 
  |   |   |   |             if (secondApplicant) {
  |   |   |   |                 nameField2 = NAMEFIELD1VALUE;
  |   |   |   |                 dateField2 = DATEFIELD1VALUE;
  |   |   |   |                 dateText2 = DATETEXT1VALUE;
  |   |   |   |                 // }
  |   |   |   |             }
  |   |   |   |             this.mapPrint.put(NAMEFIELD1, NAMEFIELD1VALUE);
  |   |   |   |             this.mapPrint.put(DATEFIELD1, DATEFIELD1VALUE);
  |   |   |   |             this.mapPrint.put(DATETEXT1, DATETEXT1VALUE);
  |   |   |   |             this.mapPrint.put(NAMEFIELD2, nameField2);
  |   |   |   |             this.mapPrint.put(DATEFIELD2, dateField2);
  |   |   |   |             this.mapPrint.put(DATETEXT2, dateText2);
  |   |   |   |             this.mapPrint.put(DEALERNAME, "Dealer: " + this.getDealer().getFranchiseName().toUpperCase()
  |   |   |   |                     + " and Services Dealer: " + getApplication().getServiceProvider().getName().toUpperCase());
  |   |   |   | 
  |   |   |   |         } else {
  |   |   |   | 
  |   |   |   |             this.mapPrint.put(DEALERNAME, this.getDealer().getFranchiseName());
  |   |   |   | 
  |   |   |   |         }
  |   |   |   | 
  |   |   |   |     }
  |   |   |   | 
  |   |   |   |     public boolean validateSecondApplicant() {
  |   |   |   |         if (!getApplication().getApplicant2().getCustomer().getFirstName().trim().equals(Tokens.BLANK)
  |   |   |   |                 && !getApplication().getApplicant2().getCustomer().getSurname().trim().equals(Tokens.BLANK)) {
  |   |   |   |             setSecondApplicant(true);
  |   |   |   |             return true;
  |   |   |   |         } else if (getApplication().getApplicant2().getCustomer().getFirstName().trim().equals(Tokens.BLANK)
  |   |   |   |                 && getApplication().getApplicant2().getCustomer().getSurname().trim().equals(Tokens.BLANK)
  |   |   |   |                 && getApplication().getApplicant2().getCustomer().getMiddleName().trim().equals(Tokens.BLANK)) {
  |   |   |   |             setSecondApplicant(false);
  |   |   |   |             return true;
  |   |   |   |         } else if (!getApplication().getApplicant2().getCustomer().getFirstName().trim().equals(Tokens.BLANK)
  |   |   |   |                 || !getApplication().getApplicant2().getCustomer().getSurname().trim().equals(Tokens.BLANK)
  |   |   |   |                 || !getApplication().getApplicant2().getCustomer().getMiddleName().trim().equals(Tokens.BLANK)) {
  |   |   |   |             setSecondApplicant(false);
  |   |   |   |             facesMessages.add(Util.getBundledMessageResource(Tokens.MSG_INVALIDNAME_SECONDAPPPLICANT));
  |   |   |   |         }
  |   |   |   |         return false;
  |   |   |   |     }
  |   |   |   | 
  |   |   |   |     public boolean validateLocation() {
  |   |   |   |         try {
  |   |   |   | 
  |   |   |   |             int idDealer = Util.obtainDealerId(this.autoCompleteLocation.getCompanySel(), this.autoCompleteLocation.getStoreSel(), this.autoCompleteLocation.getDealerSel());
  |   |   |   |             int idCompany = Util.obtainCompanyId(this.autoCompleteLocation.getCompanySel());
  |   |   |   |             int idStore = Util.obtainStoreId(this.autoCompleteLocation.getCompanySel(), this.autoCompleteLocation.getStoreSel());
  |   |   |   |             getApplication().setDealerId(null);
  |   |   |   |             getApplication().setStoreId(null);
  |   |   |   |             this.setDealerName(null);
  |   |   |   |             this.setStoreName(null);
  |   |   |   |             this.setCompanyName(null);
  |   |   |   | 
  |   |   |   |             this.setDealer(null);
  |   |   |   |             if (idDealer > 0) {
  |   |   |   | 
  |   |   |   |                 DealerCache dealerCache = (DealerCache) AppContext.getCache(DealerCache.class.getSimpleName());
  |   |   |   |                 Dealer dealerAux = (Dealer) dealerCache.getEntityById(idDealer);
  |   |   |   | 
  |   |   |   |                 StoreCache storeCache = (StoreCache) AppContext.getCache(StoreCache.class.getSimpleName());
  |   |   |   |                 Store storeAux = (Store) storeCache.getEntityById(idStore);
  |   |   |   | 
  |   |   |   |                 CompanyCache companyCache = (CompanyCache) AppContext.getCache(CompanyCache.class.getSimpleName());
  |   |   |   |                 Company companyAux = (Company) companyCache.getEntityById(idCompany);
  |   |   |   | 
  |   |   |   |                 if (dealerAux != null) {
  |   |   |   |                     getApplication().setDealerId(dealerAux.getId());
  |   |   |   |                     getApplication().setStoreId(dealerAux.getStoreId());
  |   |   |   |                     this.setDealer(dealerAux);
  |   |   |   |                     this.setDealerName(dealerAux.getDepartmentCode() + Tokens.DASH + dealerAux.getFranchiseName());
  |   |   |   |                     this.setStoreName(storeAux.getStoreCode() + Tokens.DASH + storeAux.getName());
  |   |   |   |                     this.setCompanyName(companyAux.getCompanyCode() + Tokens.DASH + companyAux.getName());
  |   |   |   |                     return true;
  |   |   |   |                 }
  |   |   |   | 
  |   |   |   |             }
  |   |   |   |             facesMessages.add(Util.getBundledMessageResource(Tokens.MSG_INVALID_LOCATION));
  |   |   |   |             return false;
  |   |   |   |         } catch (Exception e) {
  |   |   |   |             facesMessages.add(Util.getBundledMessageResource(Tokens.MSG_INVALID_LOCATION));
  |   |   |   |             return false;
  |   |   |   |         }
  |   |   |   |     }
  |   |   |   | 
  |   |   |   |     public void calculateSerialNumber() {
  |   |   |   |         double serialNoSyst = Math.random() * MAX_SERIAL;
  |   |   |   | 
  |   |   |   |         getApplication().setSerialNo(getDealer().getDepartmentCode() + (int) serialNoSyst + Tokens.BLANK);
  |   |   |   |     }
  |   |   |   | 
  |   |   |   |     public boolean validaSerialNumber() {
  |   |   |   |         if (getSerialNumberUser() != null) {
  |   |   |   |             if (getSerialNumberUser().equals("111")) { // return
  |   |   |   |                                                         // getApplication().getSerialNo().equals(getSerialNumberUser());
  |   |   |   |                 return true;
  |   |   |   |             } else {
  |   |   |   |                 facesMessages.add(Util.getBundledMessageResource(Tokens.MSG_INVALID_SERIALNUMBER));
  |   |   |   |                 return false;
  |   |   |   |             }
  |   |   |   | 
  |   |   |   |         } else {
  |   |   |   |             facesMessages.add(Util.getBundledMessageResource(Tokens.MSG_INVALID_SERIALNUMBER));
  |   |   |   |             return false;
  |   |   |   |         }
  |   |   |   |     }
  |   |   |   | 
  |   |   |   |     public boolean validaDefaultPrintPrivacy() {
  |   |   |   |         if ((Util.getBundledMessageResource(Tokens.DEFAULTPRINTPRIVACY).toUpperCase().equals(Tokens.YES))) {
  |   |   |   |             return true;
  |   |   |   |         } else {
  |   |   |   |             return false;
  |   |   |   |         }
  |   |   |   |     }
  |   |   |   | 
  |   |   |   |     public boolean validaInvoiceNo() {
  |   |   |   | 
  |   |   |   |         if (Util.getApplicationService().isUniqueInvoiceNo(this.getDealer(), getApplication().getPrimaryInvoice().getInvoiceNo())) {
  |   |   |   |             // this.setMsgWrongInvoiceNo(Util.getBundledMessageResource(Tokens.BLANK));
  |   |   |   |             return true;
  |   |   |   |         } else {
  |   |   |   |             // this.setMsgWrongInvoiceNo(Util.getBundledMessageResource(Tokens.MSG_INVALID_INVOICENO));
  |   |   |   |             facesMessages.add( Util.getBundledMessageResource(Tokens.MSG_INVALID_INVOICENO));
  |   |   |   |             return false;
  |   |   |   |         }
  |   |   |   |     }
  |   |   |   | 
  |   |   |   |     public String getSurnameSearch() {
  |   |   |   |         return surnameSearch;
  |   |   |   |     }
  |   |   |   | 
  |   |   |   |     public void setSurnameSearch(String surnameSearch) {
  |   |   |   |         this.surnameSearch = surnameSearch;
  |   |   |   |     }
  |   |   |   | 
  |   |   |   |     public String getFirstNameSearch() {
  |   |   |   |         return firstNameSearch;
  |   |   |   |     }
  |   |   |   | 
  |   |   |   |     public void setFirstNameSearch(String firstNameSearch) {
  |   |   |   |         this.firstNameSearch = firstNameSearch;
  |   |   |   |     }
  |   |   |   | 
  |   |   |   |   
  |   |   |   |     public String getSerialNumberUser() {
  |   |   |   |         return serialNumberUser;
  |   |   |   |     }
  |   |   |   | 
  |   |   |   |     public void setSerialNumberUser(String serialNumberUser) {
  |   |   |   |         this.serialNumberUser = serialNumberUser;
  |   |   |   |     }
  |   |   |   | 
  |   |   |   |    
  |   |   |   | 
  |   |   |   | 
  |   |   |   |     @DataModel
  |   |   |   |     public List<Customer> getListPossibleDebtors() {
  |   |   |   |         return listPossibleDebtors;
  |   |   |   |     }
  |   |   |   | 
  |   |   |   |     public void setListPossibleDebtors(List<Customer> listPossibleDebtors) {
  |   |   |   |         this.listPossibleDebtors = listPossibleDebtors;
  |   |   |   |     }
  |   |   |   | 
  |   |   |   |     public boolean getServiceProvider() {
  |   |   |   |         return serviceProvider;
  |   |   |   |     }
  |   |   |   | 
  |   |   |   |     public void setServiceProvider(boolean serviceProvider) {
  |   |   |   |         this.serviceProvider = serviceProvider;
  |   |   |   |     }
  |   |   |   | 
  |   |   |   |     public String getIdServiceProvider() {
  |   |   |   |         return idServiceProvider;
  |   |   |   |     }
  |   |   |   | 
  |   |   |   |     public void setIdServiceProvider(String idServiceProvider) {
  |   |   |   |         this.idServiceProvider = idServiceProvider;
  |   |   |   |     }
  |   |   |   | 
  |   |   |   |     public boolean isSecondApplicant() {
  |   |   |   |         return secondApplicant;
  |   |   |   |     }
  |   |   |   | 
  |   |   |   |     public void setSecondApplicant(boolean secondApplicant) {
  |   |   |   |         this.secondApplicant = secondApplicant;
  |   |   |   |     }
  |   |   |   | 
  |   |   |   |     public Customer getCustomerSelected() {
  |   |   |   |         return customerSelected;
  |   |   |   |     }
  |   |   |   | 
  |   |   |   |     public void setCustomerSelected(Customer customerSelected) {
  |   |   |   |         this.customerSelected = customerSelected;
  |   |   |   |     }
  |   |   |   | 
  |   |   |   |     public void setSelectCustomerOne() {
  |   |   |   |         if (customerSelected != null) {
  |   |   |   |             getApplication().getApplicant1().setCustomer(customerSelected);
  |   |   |   |             if (customerSelected.getLatestAppCustomer() != null) {
  |   |   |   |                 Application app = Util.getApplicationService().findApplicationById(
  |   |   |   |                         customerSelected.getLatestAppCustomer().getApplication().getId());
  |   |   |   |                 application.getApplicant1().copyFrom(app.getApplicant1());
  |   |   |   |             }
  |   |   |   | 
  |   |   |   |         }
  |   |   |   |     }
  |   |   |   | 
  |   |   |   |     public Application getApplication() {
  |   |   |   |         return application;
  |   |   |   |     }
  |   |   |   | 
  |   |   |   |     public void setApplication(Application application) {
  |   |   |   |         this.application = application;
  |   |   |   |     }
  |   |   |   | 
  |   |   |   |     public void createApplication() {
  |   |   |   | 
  |   |   |   |         getApplication().setStoreId(getDealer().getStoreId());
  |   |   |   |         getApplication().setDealerId(getDealer().getId());
  |   |   |   |         getApplication().setFranchiseCode(getDealer().getFranchiseCode());
  |   |   |   | 
  |   |   |   |         getApplication().getApplicant1().setApplication(getApplication());
  |   |   |   |         getApplication().getPrimaryInvoice().setDealerId(getApplication().getDealerId());
  |   |   |   |         getApplication().getPrimaryInvoice().setApplication(getApplication());
  |   |   |   |         getApplication().getPrimaryInvoice().setStoreId(getApplication().getStoreId());
  |   |   |   | 
  |   |   |   |         if (isSecondApplicant()) {
  |   |   |   |             getApplication().getApplicant2().setApplication(getApplication());
  |   |   |   | 
  |   |   |   |         } else {
  |   |   |   |             getApplication().setApplicant2(null);
  |   |   |   |         }
  |   |   |   | 
  |   |   |   |         Util.getApplicationService().save(getApplication());
  |   |   |   | 
  |   |   |   |     }
  |   |   |   | 
  |   |   |   |     public List<ServiceProvider> getListServiceProviders() {
  |   |   |   | 
  |   |   |   |         ServiceProviderCache serviceProviderCache = (ServiceProviderCache) AppContext.getCache(ServiceProviderCache.class
  |   |   |   |                 .getSimpleName());
  |   |   |   |         List<ServiceProvider> serviceProviders = (List<ServiceProvider>) serviceProviderCache.getEntityList();
  |   |   |   | 
  |   |   |   |         return serviceProviders;
  |   |   |   | 
  |   |   |   |     }
  |   |   |   | 
  |   |   |   |     public void onSelectServiceProvider(ValueChangeEvent event) {
  |   |   |   |         ServiceProvider serProvider = (ServiceProvider) event.getNewValue();
  |   |   |   |         getApplication().setServiceProvider(serProvider);
  |   |   |   | 
  |   |   |   |     }
  |   |   |   | 
  |   |   |   |     
  |   |   |   |     public void setPrinting() {
  |   |   |   |         this.setFlgPrint(true);
  |   |   |   |     }
  |   |   |   |     
  |   |   |   |     public void setNoPrinting() {
  |   |   |   |         this.setFlgPrint(false);
  |   |   |   |     }
  |   |   |   | 
  |   |   |   |     public Dealer getDealer() {
  |   |   |   |         return dealer;
  |   |   |   |     }
  |   |   |   | 
  |   |   |   |     public void setDealer(Dealer dealer) {
  |   |   |   |         this.dealer = dealer;
  |   |   |   |     }
  |   |   |   | 
  |   |   |   |     public String getCompanyName() {
  |   |   |   |         return companyName;
  |   |   |   |     }
  |   |   |   | 
  |   |   |   |     public void setCompanyName(String companyName) {
  |   |   |   |         this.companyName = companyName;
  |   |   |   |     }
  |   |   |   | 
  |   |   |   |     public String getDealerName() {
  |   |   |   |         return dealerName;
  |   |   |   |     }
  |   |   |   | 
  |   |   |   |     public void setDealerName(String dealerName) {
  |   |   |   |         this.dealerName = dealerName;
  |   |   |   |     }
  |   |   |   | 
  |   |   |   |     public String getStoreName() {
  |   |   |   |         return storeName;
  |   |   |   |     }
  |   |   |   | 
  |   |   |   |     public void setStoreName(String storeName) {
  |   |   |   |         this.storeName = storeName;
  |   |   |   |     }
  |   |   |   | 
  |   |   |   |     public boolean isFlgPrint() {
  |   |   |   |         return flgPrint;
  |   |   |   |     }
  |   |   |   | 
  |   |   |   |     public void setFlgPrint(boolean flgPrint) {
  |   |   |   |         this.flgPrint = flgPrint;
  |   |   |   |     }
  |   |   |   | 
  |   |   |   |     public AutoCompleteLocation getAutoCompleteLocation() {
  |   |   |   |         return autoCompleteLocation;
  |   |   |   |     }
  |   |   |   | 
  |   |   |   |     public void setAutoCompleteLocation(AutoCompleteLocation autoCompleteLocation) {
  |   |   |   |         this.autoCompleteLocation = autoCompleteLocation;
  |   |   |   |     }
  |   |   |   | 
  |   |   |   |     public Integer getNumRows() {
  |   |   |   |         return numRows;
  |   |   |   |     }
  |   |   |   | 
  |   |   |   |     public void setNumRows(Integer numRows) {
  |   |   |   |         this.numRows = numRows;
  |   |   |   |     }
  |   |   |   | 
  |   |   |   | }
  |   |   |   | 
  |   |   | 
  |   |   | My PageFlow
  |   |   | 
  |   |   |   | 
  |   |   |   | <pageflow-definition xmlns="http://jboss.com/products/seam/pageflow"
  |   |   |   | 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  |   |   |   | 	xsi:schemaLocation="http://jboss.com/products/seam/pageflow http://jboss.com/products/seam/pageflow-1.2.xsd"
  |   |   |   | 	name="normalCreditApplicationFlow">
  |   |   |   | 	<start-state>
  |   |   |   | 		<transition to="normal" />
  |   |   |   | 	</start-state>
  |   |   |   | 
  |   |   |   | 	<page name="normal" view-id="/normal-application.jspx"
  |   |   |   | 		back="disabled">
  |   |   |   | 		<redirect />
  |   |   |   | 		<transition name="next" to="validateLocation"></transition>
  |   |   |   | 	</page>
  |   |   |   | 
  |   |   |   | 
  |   |   |   | 	<decision name="validateLocation"
  |   |   |   | 		expression="#{normalCreditApplication.validateLocation}">
  |   |   |   | 		<transition name="true" to="validaInvoiceNo"></transition>
  |   |   |   | 		<transition name="false" to="normal"></transition>
  |   |   |   | 	</decision>
  |   |   |   | 
  |   |   |   | 	<decision name="validaInvoiceNo"
  |   |   |   | 		expression="#{normalCreditApplication.validaInvoiceNo}">
  |   |   |   | 		<transition name="true" to="validateSecondApplicant"></transition>
  |   |   |   | 		<transition name="false" to="normal"></transition>
  |   |   |   | 	</decision>
  |   |   |   | 
  |   |   |   | 	<decision name="validateSecondApplicant"
  |   |   |   | 		expression="#{normalCreditApplication.validateSecondApplicant}">
  |   |   |   | 		<transition name="true" to="validaDefaultPrintPrivacy"></transition>
  |   |   |   | 		<transition name="false" to="normal"></transition>
  |   |   |   | 	</decision>
  |   |   |   | 
  |   |   |   | 	<decision name="validaDefaultPrintPrivacy"
  |   |   |   | 		expression="#{normalCreditApplication.validaDefaultPrintPrivacy}">
  |   |   |   | 		<transition name="true" to="normalSerialNumberPrint">
  |   |   |   | 			<action
  |   |   |   | 				expression="#{normalCreditApplication.calculateSerialNumber}" />
  |   |   |   | 			<action expression="#{normalCreditApplication.setMapPrint}" />
  |   |   |   | 		</transition>
  |   |   |   | 		<transition name="false" to="normalListPossibleDebtors">
  |   |   |   | 		</transition>
  |   |   |   | 	</decision>
  |   |   |   | 
  |   |   |   | 	<page name="normalSerialNumberPrint"
  |   |   |   | 		view-id="/normal-serialnumber-print.jspx" back="enabled">
  |   |   |   | 		<redirect />
  |   |   |   | 		<transition name="previous" to="normal">
  |   |   |   | 			<action
  |   |   |   | 				expression="#{normalCreditApplication.setNoPrinting}" />
  |   |   |   | 		</transition>
  |   |   |   | 		<transition name="next" to="validaSerialNumber">
  |   |   |   | 			<action expression="#{normalCreditApplication.setPrinting}" />
  |   |   |   | 		</transition>
  |   |   |   | 	</page>
  |   |   |   | 
  |   |   |   | 
  |   |   |   | 
  |   |   |   | 
  |   |   |   | 
  |   |   |   | 
  |   |   |   | 	<decision name="validaSerialNumber"
  |   |   |   | 		expression="#{normalCreditApplication.validaSerialNumber}">
  |   |   |   | 		<transition name="true" to="normalListPossibleDebtorsPrint">
  |   |   |   | 			<action
  |   |   |   | 				expression="#{normalCreditApplication.searchPossibleDebtorsbySystem}" />
  |   |   |   | 		</transition>
  |   |   |   | 		<transition name="false" to="normalSerialNumberPrint">
  |   |   |   | 
  |   |   |   | 		</transition>
  |   |   |   | 	</decision>
  |   |   |   | 
  |   |   |   | 	<page name="normalListPossibleDebtors"
  |   |   |   | 		view-id="/list-existing-debtors.jspx" back="disabled">
  |   |   |   | 		<redirect />
  |   |   |   | 		<transition name="previous" to="normal"></transition>
  |   |   |   | 		<transition name="existingCustomerOne" to="toEditApplication">
  |   |   |   | 			<action
  |   |   |   | 				expression="#{normalCreditApplication.setSelectCustomerOne}" />
  |   |   |   | 			<action
  |   |   |   | 				expression="#{normalCreditApplication.createApplication}" />
  |   |   |   | 		</transition>
  |   |   |   | 		<transition name="newCustomerOne" to="toEditApplication">
  |   |   |   | 			<action
  |   |   |   | 				expression="#{normalCreditApplication.createApplication}" />
  |   |   |   | 		</transition>
  |   |   |   | 		<transition name="search" to="normalListPossibleDebtors">
  |   |   |   | 			<action
  |   |   |   | 				expression="#{normalCreditApplication.searchPossibleDebtorsbyUser}" />
  |   |   |   | 		</transition>
  |   |   |   | 	</page>
  |   |   |   | 
  |   |   |   | 	<page name="normalListPossibleDebtorsPrint"
  |   |   |   | 		view-id="/list-existing-debtors.jspx" back="disabled">
  |   |   |   | 		<redirect />
  |   |   |   | 		<transition name="previous" to="normalSerialNumberPrint"></transition>
  |   |   |   | 		<transition name="existingCustomerOne" to="toEditApplication">
  |   |   |   | 			<action
  |   |   |   | 				expression="#{normalCreditApplication.setSelectCustomerOne}" />
  |   |   |   | 			<action
  |   |   |   | 				expression="#{normalCreditApplication.createApplication}" />
  |   |   |   | 		</transition>
  |   |   |   | 		<transition name="newCustomerOne" to="toEditApplication">
  |   |   |   | 			<action
  |   |   |   | 				expression="#{normalCreditApplication.createApplication}" />
  |   |   |   | 		</transition>
  |   |   |   | 		<transition name="search" to="normalListPossibleDebtors">
  |   |   |   | 			<action
  |   |   |   | 				expression="#{normalCreditApplication.searchPossibleDebtorsbyUser}" />
  |   |   |   | 		</transition>
  |   |   |   | 	</page>
  |   |   |   | 
  |   |   |   | 	<page name="toEditApplication" view-id="/loan-application.jspx">
  |   |   |   | 		<redirect />
  |   |   |   | 	</page>
  |   |   |   | 
  |   |   |   | 	<page name="salary" view-id="/salaryApplication.jspx"
  |   |   |   | 		back="disabled">
  |   |   |   | 		<redirect />
  |   |   |   | 		<end-conversation />
  |   |   |   | 	</page>
  |   |   |   | 
  |   |   |   | </pageflow-definition>
  |   |   |   | 
  |   |   | 
  |   |   | Error
  |   |   | 
  |   |   |   | 
  |   |   |   | 2007-08-06 09:21:53 StandardWrapperValve[FacesServlet]: Servlet.service() for servlet FacesServlet threw exception
  |   |   |   | javax.faces.el.EvaluationException: /normal-application.jspx @13,72 rendered="#{normalCreditApplication.serviceProvider}": Exception getting value of property serviceProvider of base of type : com.yoogalu.ncf.web.seam.bean.NormalCreditApplication_$$_javassist_2
  |   |   |   | 	at com.sun.facelets.el.LegacyValueBinding.getValue(LegacyValueBinding.java:60)
  |   |   |   | 	at javax.faces.component.UIComponentBase.isRendered(UIComponentBase.java:1078)
  |   |   |   | 	at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:601)
  |   |   |   | 	at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:605)
  |   |   |   | 	at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:605)
  |   |   |   | 	at javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:138)
  |   |   |   | 	at org.ajax4jsf.framework.ajax.AjaxViewRoot.access$001(AjaxViewRoot.java:53)
  |   |   |   | 	at org.ajax4jsf.framework.ajax.AjaxViewRoot$1.invokeRoot(AjaxViewRoot.java:256)
  |   |   |   | 	at org.ajax4jsf.framework.ajax.JsfOneOneInvoker.invokeOnRegionOrRoot(JsfOneOneInvoker.java:53)
  |   |   |   | 	at org.ajax4jsf.framework.ajax.AjaxContext.invokeOnRegionOrRoot(AjaxContext.java:191)
  |   |   |   | 	at org.ajax4jsf.framework.ajax.AjaxViewRoot.processDecodes(AjaxViewRoot.java:272)
  |   |   |   | 	at org.apache.myfaces.lifecycle.ApplyRequestValuesExecutor.execute(ApplyRequestValuesExecutor.java:32)
  |   |   |   | 	at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:95)
  |   |   |   | 	at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:70)
  |   |   |   | 	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:139)
  |   |   |   | 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
  |   |   |   | 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
  |   |   |   | 	at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
  |   |   |   | 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
  |   |   |   | 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
  |   |   |   | 	at com.yoogalu.ncf.web.servlet.Boilerplate.doFilter(Boilerplate.java:42)
  |   |   |   | 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
  |   |   |   | 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
  |   |   |   | 	at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:127)
  |   |   |   | 	at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:277)
  |   |   |   | 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
  |   |   |   | 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
  |   |   |   | 	at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:264)
  |   |   |   | 	at org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107)
  |   |   |   | 	at org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72)
  |   |   |   | 	at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
  |   |   |   | 	at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:110)
  |   |   |   | 	at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
  |   |   |   | 	at org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:81)
  |   |   |   | 	at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
  |   |   |   | 	at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:217)
  |   |   |   | 	at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
  |   |   |   | 	at org.acegisecurity.ui.logout.LogoutFilter.doFilter(LogoutFilter.java:106)
  |   |   |   | 	at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
  |   |   |   | 	at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:229)
  |   |   |   | 	at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
  |   |   |   | 	at org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:148)
  |   |   |   | 	at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)
  |   |   |   | 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
  |   |   |   | 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
  |   |   |   | 	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
  |   |   |   | 	at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
  |   |   |   | 	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
  |   |   |   | 	at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
  |   |   |   | 	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
  |   |   |   | 	at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
  |   |   |   | 	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
  |   |   |   | 	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
  |   |   |   | 	at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
  |   |   |   | 	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
  |   |   |   | 	at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
  |   |   |   | 	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
  |   |   |   | 	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
  |   |   |   | 	at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
  |   |   |   | 	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
  |   |   |   | 	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
  |   |   |   | 	at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
  |   |   |   | 	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
  |   |   |   | 	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
  |   |   |   | 	at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
  |   |   |   | 	at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
  |   |   |   | 	at java.lang.Thread.run(Thread.java:595)
  |   |   |   | Caused by: javax.faces.el.EvaluationException: Bean: com.yoogalu.ncf.web.seam.bean.NormalCreditApplication_$$_javassist_2, property: serviceProvider
  |   |   |   | 	at org.apache.myfaces.el.PropertyResolverImpl.getProperty(PropertyResolverImpl.java:461)
  |   |   |   | 	at org.apache.myfaces.el.PropertyResolverImpl.getValue(PropertyResolverImpl.java:85)
  |   |   |   | 	at com.sun.facelets.el.LegacyELContext$LegacyELResolver.getValue(LegacyELContext.java:141)
  |   |   |   | 	at com.sun.el.parser.AstValue.getValue(AstValue.java:118)
  |   |   |   | 	at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:192)
  |   |   |   | 	at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:71)
  |   |   |   | 	at com.sun.facelets.el.LegacyValueBinding.getValue(LegacyValueBinding.java:56)
  |   |   |   | 	... 66 more
  |   |   |   | Caused by: java.lang.reflect.InvocationTargetException
  |   |   |   | 	at sun.reflect.GeneratedMethodAccessor162.invoke(Unknown Source)
  |   |   |   | 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  |   |   |   | 	at java.lang.reflect.Method.invoke(Method.java:585)
  |   |   |   | 	at org.apache.myfaces.el.PropertyResolverImpl.getProperty(PropertyResolverImpl.java:457)
  |   |   |   | 	... 72 more
  |   |   |   | Caused by: org.jboss.seam.NoConversationException: no long-running conversation for @Conversational bean: normalCreditApplication
  |   |   |   | 	at org.jboss.seam.interceptors.ConversationalInterceptor.aroundInvoke(ConversationalInterceptor.java:55)
  |   |   |   | 	at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
  |   |   |   | 	at org.jboss.seam.interceptors.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:27)
  |   |   |   | 	at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
  |   |   |   | 	at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:103)
  |   |   |   | 	at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:151)
  |   |   |   | 	at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:87)
  |   |   |   | 	at com.yoogalu.ncf.web.seam.bean.NormalCreditApplication_$$_javassist_2.getServiceProvider(NormalCreditApplication_$$_javassist_2.java)
  |   |   |   | 	... 76 more
  |   |   |   | 
  |   |   | 
  |   |   | 

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

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



More information about the jboss-user mailing list