Advertisement
Guest User

Untitled

a guest
Feb 9th, 2017
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 121.68 KB | None | 0 0
  1. RegisterCustomerPanel.html::::
  2. ________________________________
  3.  
  4.  
  5.  
  6. <html
  7.     xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd">
  8. <head>
  9. <wicket:head>
  10.     <script src="scripts/jquery/jquery-ui-1.8.17.custom.min.js"></script>
  11.     <script src="scripts/jquery/jquery.min.js"></script>
  12.     <script src="scripts/jquery/jquery-ui.min.js"></script>
  13.     <script src="scripts/jquery/jquery.maskedinput.js"></script>
  14.     <script>
  15.         jQuery(function($){
  16.             $("#identityValue").mask("99999-9999999-9");
  17.             $("#cnicBeneficial").mask("99999-9999999-9");
  18.             $("#msisdn").mask("03999999999");
  19.         });
  20.     </script>
  21.     <script src="scripts/jquery/customization.js">function();</script>
  22.  
  23. </wicket:head>
  24. </head>
  25. <body>
  26.  
  27.     <wicket:panel>
  28.  
  29.         <form wicket:id="registerCustomerForm">
  30.  
  31.             <div wicket:id="errorMessages"></div>
  32.  
  33.  
  34.             <div class="column">
  35.  
  36.                 <div wicket:id="businessDetailDiv">
  37.  
  38.                     <h2 class="section personal">
  39.                         <wicket:message key="businessDetail.headLine" />
  40.                     </h2>
  41.  
  42.                     <div class="input" wicket:id="businessNameDiv"
  43.                         style="width: 1000px">
  44.                         <label for="businessName"> <wicket:message
  45.                                 key="customer.businessName" /> <span class="required">*</span>
  46.                         </label> <input tabindex="1" type="text" style="width: 533px"
  47.                             wicket:id="customer.businessName" id="businessName" size="80" />
  48.                     </div>
  49.  
  50.                     <div class="input" wicket:id="ntnNumberDiv">
  51.                         <label for="ntnNumber"> <wicket:message key="ntnNumber" />
  52.                             <!--  <span
  53.                         class="required">*</span> -->
  54.                         </label> <input tabindex="2" type="text" wicket:id="customer.ntnNumber"
  55.                             id="ntnNumber" size="40" />
  56.                     </div>
  57.                 </div>
  58.             </div>
  59.  
  60.  
  61.             <div class="column">
  62.  
  63.                 <h2 class="section personal">
  64.                     <wicket:message key="generalInfo.headLine" />
  65.                 </h2>
  66.  
  67.  
  68.                 <!-- For L2 Individual start style="padding-left: 6px"-->
  69.                 <div class="column" style="padding-left: 6px">
  70.                     <div class="input" style="width: 1000px">
  71.                         <label for="nameAsPerCNIC"> <wicket:message
  72.                                 key="nameAsPerCNIC" /> <span class="required">*</span>
  73.                         </label> <input tabindex="3" type="text" style="width: 533px"
  74.                             wicket:id="customer.address.nameAsPerCNIC" id="nameAsPerCNIC"
  75.                             size="40" />
  76.                     </div>
  77.  
  78.  
  79.                 </div>
  80.  
  81.  
  82.                 <!-- For L2 Individual end -->
  83.  
  84.  
  85.                 <div class="column twoColumn">
  86.  
  87.  
  88.                     <div class="input" wicket:id="fatherHusbandNameDiv">
  89.                         <label for="fatherHusbandName"><wicket:message
  90.                                 key="fatherHusbandName" /><span class="required">*</span></label> <input
  91.                             tabindex="4" type="text" wicket:id="customer.fatherHusbandName"
  92.                             id="fatherHusbandName" size="20" />
  93.                     </div>
  94.  
  95.  
  96.                     <div class="input" wicket:id="genderDiv">
  97.                         <label for="kvGender"><wicket:message key="gender" /><span
  98.                             class="required">*</span></label> <select tabindex="5"
  99.                             wicket:id="customer.address.kvGender" id="kvGender">
  100.                             <option>dummy</option>
  101.                         </select>
  102.                     </div>
  103.                     <div class="input" wicket:id="birthDateDiv">
  104.                         <label for="birthDate"><wicket:message key="birthDate" /><span class="required">*</span></label>
  105.                         <input readonly="readonly" tabindex="6" type="text" size="10" wicket:id="birthDateField" id="birthDate"
  106.                         style="width: 150px;" />
  107.                     </div>
  108.  
  109.                 </div>
  110.  
  111.  
  112.                 <div class="column twoColumn">
  113.  
  114.                     <div class="input" wicket:id="motherNameDiv">
  115.                         <label for="motherName"><wicket:message key="motherName" /><span
  116.                             class="required">*</span></label> <input tabindex="7" type="text"
  117.                             wicket:id="customer.motherName" id="motherName" size="20" />
  118.                     </div>
  119.  
  120.                     <div class="input" wicket:id="placeOfBirthDiv">
  121.                         <label for="placeOfBirth"><wicket:message
  122.                                 key="placeOfBirth" /><span class="required">*</span></label> <input
  123.                             tabindex="8" type="text"
  124.                             wicket:id="customer.address.placeOfBirth" id="placeOfBirth"
  125.                             size="20" />
  126.                     </div>
  127.  
  128.                     <div class="input" wicket:id="customerTypeDiv">
  129.                         <label for="customerTypeId"> <wicket:message
  130.                                 key="customerType" /> <span class="required">*</span>
  131.                         </label> <select tabindex="9" wicket:id="customer.customerTypeId"
  132.                             id="customerTypeId">
  133.                             <option>dummy</option>
  134.                         </select>
  135.                     </div>
  136.  
  137.  
  138.                     <div class="input" wicket:id="titleDiv">
  139.                         <label for="title"> <wicket:message key="title" />
  140.                         </label> <input tabindex="10" type="text"
  141.                             wicket:id="customer.address.title" id="title" size="20" />
  142.                     </div>
  143.  
  144.                     <!-- This is the section for merchant kyc -->
  145.  
  146.                 </div>
  147.  
  148.                 <div class="column buffer"></div>
  149.  
  150.                 <h2 class="section house">
  151.                     <wicket:message key="addressInfo.headLine" />
  152.                 </h2>
  153.  
  154.                 <div class="column" style="padding-left: 6px">
  155.                
  156.                     <div class="input" wicket:id="permanentAddressDiv"
  157.                         style="width: 1000px">
  158.                         <label for="permanentAddress"> <wicket:message
  159.                                 key="permanentAddress" /><span class="required">*</span></label> <input
  160.                             tabindex="11" type="text" style="width: 533px"
  161.                             wicket:id="customer.address.permanentAddress"
  162.                             id="permanentAddress" />
  163.                     </div>
  164.  
  165.                     <div class="input" wicket:id="mailingAddressDiv"
  166.                         style="width: 1000px">
  167.                         <label for="mailingAddress"><wicket:message
  168.                                 key="mailingAddress" /><span class="required">*</span></label> <input
  169.                             tabindex="12" type="text" style="width: 533px"
  170.                             wicket:id="customer.address.mailingAddress" id="mailingAddress"
  171.                             size="40" />
  172.                     </div>
  173.  
  174.                     <div class="input" wicket:id="businessAddressDiv"
  175.                         style="width: 1000px">
  176.                         <label for="businessAddress"><wicket:message
  177.                                 key="businessAddress" /><span class="required">*</span></label> <input
  178.                             tabindex="13" type="text" style="width: 533px"
  179.                             wicket:id="customer.address.businessAddress" id="businessAddress"
  180.                             size="40" />
  181.                     </div>
  182.                      
  183.                 </div>
  184.  
  185.                 <div class="column twoColumn">
  186.  
  187.                     <div class="input">
  188.                         <label for="state"><wicket:message key="state" /><span
  189.                             class="required">*</span></label> <select tabindex="14"
  190.                             wicket:id="customer.address.state" id="state">
  191.                             <option>dummy</option>
  192.                         </select>
  193.                     </div>
  194.  
  195.                 </div>
  196.  
  197.                 <div class="column twoColumn">
  198.  
  199.                     <div class="input">
  200.                         <label for="city"><wicket:message key="city" /><span
  201.                             class="required">*</span></label> <input tabindex="15" type="text"
  202.                             wicket:id="customer.address.city" id="city" />
  203.                     </div>
  204.  
  205.                 </div>
  206.  
  207.                 <div class="column buffer"></div>
  208.  
  209.                 <h2 class="section phone">
  210.                     <wicket:message key="contactInfo.headLine" />
  211.                 </h2>
  212.  
  213.                 <div class="column twoColumn">
  214.  
  215.                     <div class="input" wicket:id="msisdnDiv">
  216.                         <label for="msisdn"><wicket:message key="msisdn" /><span
  217.                             class="required">*</span></label> <input tabindex="16" type="text"
  218.                             wicket:id="customer.msisdn" id="msisdn" size="20" />
  219.                     </div>
  220.  
  221.                     <div class="input" wicket:id="emailDiv">
  222.                         <label for="email"><wicket:message key="email" /><span
  223.                             class="required">*</span></label> <input tabindex="20" type="text"
  224.                             wicket:id="customer.address.email" id="email" size="50" />
  225.                     </div>
  226.                    
  227.                     <div class="input" wicket:id="rolesAndPrivilegesDiv">
  228.                         <label for="roles"><wicket:message key="roles" /><span
  229.                             class="required">*</span></label> <select tabindex="5"
  230.                             wicket:id="customer.roles" id="roles">
  231.                             <option>dummy</option>
  232.                         </select>
  233.                     </div>
  234.  
  235.                 </div>
  236.  
  237.                 <div class="column twoColumn">
  238.  
  239.                     <div wicket:id="infoModeDiv">
  240.  
  241.                         <div class="input" wicket:id="kvInfoModeDiv">
  242.                             <label for="kvInfoMode"><wicket:message key="infoMode" /><span
  243.                                 class="required">*</span></label> <select tabindex="21"
  244.                                 wicket:id="customer.kvInfoMode" id="kvInfoMode">
  245.                                 <option>dummy</option>
  246.                             </select>
  247.                         </div>
  248.  
  249.                         <div class="input" wicket:id="landLineDiv">
  250.                             <label for="landLine"><wicket:message key="landLine" />
  251.                             </label> <input tabindex="16" type="text"
  252.                                 wicket:id="customer.address.landLine" id="landLine" size="20" />
  253.                         </div>
  254.                        
  255.                         <div class="input" wicket:id="networkProviderDiv">
  256.                             <label for="networkProvider"><wicket:message
  257.                                     key="Network Provider" /><span class="required">*</span></label> <select
  258.                                 tabindex="22" wicket:id="customer.networkProvider"
  259.                                 id="networkProvider">
  260.                                 <option>dummy</option>
  261.                             </select>
  262.                         </div>
  263.                          
  264.                     </div>
  265.  
  266.  
  267.                 </div>
  268.  
  269.                 <div class="column buffer"></div>
  270.  
  271.                 <div wicket:id="identityInfoDiv">
  272.  
  273.                     <h2 class="section person" wicket:id="identityInfoTitleDiv">
  274.                         <wicket:message key="identityInfo.headLine" />
  275.                     </h2>
  276.  
  277.                     <div class="column twoColumn">
  278.  
  279.                         <div class="input" wicket:id="kvIdentityTypeDiv" style="width: 565px;">
  280.                             <label for="kvIdentityType"><wicket:message
  281.                                     key="identityType" /><span class="required"
  282.                                 wicket:id="requiredIdentityType"></span></label> <select tabindex="23"
  283.                                 wicket:id="customer.kvIdentityType" id="kvIdentityType">
  284.                                 <option>dummy</option>
  285.                             </select>
  286.                         </div>
  287.  
  288.                         <div class="input" wicket:id="cnicExpiryDateDiv">
  289.                             <label for="cnicExpiryDate"><wicket:message
  290.                                     key="cnicExpiryDate" /><span class="required">*</span></label> <input
  291.                                 readonly="readonly" tabindex="24" type="text" size="10"
  292.                                 wicket:id="cnicExpiryDateField" id="cnicExpiryDate"
  293.                                 style="width: 150px;" />
  294.                         </div>
  295.  
  296.                     </div>
  297.  
  298.                     <div class="column twoColumn">
  299.  
  300.                         <div class="input" wicket:id="kvIdentityValueDiv">
  301.                             <label for="identityValue"> <wicket:message
  302.                                     key="identityValue" /> <span class="required">*</span>
  303.                             </label> <input tabindex="25" type="text"
  304.                                 wicket:id="customer.identityValue" id="identityValue" />
  305.                         </div>
  306.  
  307.                     </div>
  308.                 </div>
  309.  
  310.                 <!-- Customization for Merchant Account Profile start-->
  311.                 <div class="column buffer"></div>
  312.  
  313.  
  314.                 <div wicket:id="accountProfileMerchantDiv">
  315.  
  316.                     <h2 class="section person">
  317.                         <wicket:message key="accountProfile.headLine" />
  318.                     </h2>
  319.  
  320.                     <div class="column twoColumn">
  321.  
  322.                         <div class="input" wicket:id="monthlyExpectedDepositDiv">
  323.                             <label for="monthlyExpectedDeposit"> <wicket:message
  324.                                     key="monthlyExpectedDeposit" /> <span class="required"
  325.                                 wicket:id="requiredMonthlyExpectedDeposit"></span>
  326.                             </label> <input tabindex="26" type="text"
  327.                                 wicket:id="customer.kycDetailsBean.monthlyExpectedDeposit"
  328.                                 id="monthlyExpectedDeposit" size="20" />
  329.                         </div>
  330.  
  331.                         <div class="input" wicket:id="monthlyExpectedWithdrawalDiv">
  332.                             <label for="monthlyExpectedWithdrawal"> <wicket:message
  333.                                     key="monthlyExpectedWithdrawal" /> <span class="required"
  334.                                 wicket:id="requiredMonthlyExpectedWithdrawal"></span>
  335.                             </label> <input tabindex="27" type="text"
  336.                                 wicket:id="customer.kycDetailsBean.monthlyExpectedWithdrawal"
  337.                                 id="monthlyExpectedWithdrawal" size="20" />
  338.                         </div>
  339.  
  340.                         <div class="input" wicket:id="expectedAvgBalanceDiv">
  341.                             <label for="expectedAvgBalance"> <wicket:message
  342.                                     key="expectedAvgBalance" /> <span class="required"
  343.                                 wicket:id="requiredExpectedAvgBalance"></span>
  344.                             </label> <input tabindex="28" type="text"
  345.                                 wicket:id="customer.kycDetailsBean.expectedAvgBalance"
  346.                                 id="expectedAvgBalance" size="20" />
  347.                         </div>
  348.  
  349.                     </div>
  350.  
  351.                     <div class="column twoColumn">
  352.  
  353.                         <div class="input" wicket:id="annualTurnoverDiv">
  354.                             <label for="annualTurnover"> <wicket:message
  355.                                     key="annualTurnover" /> <span class="required"
  356.                                 wicket:id="requiredAnnualTurnover"></span>
  357.                             </label> <input tabindex="29" type="text"
  358.                                 wicket:id="customer.kycDetailsBean.annualTurnover"
  359.                                 id="annualTurnover" size="20" />
  360.                         </div>
  361.  
  362.                         <div class="input" wicket:id="expectedMonthlyCreditSalesDiv">
  363.  
  364.                             <label for="expectedMonthlyCreditSales"> <wicket:message
  365.                                     key="expectedMonthlyCreditSales" /> <span class="required"
  366.                                 wicket:id="requiredExpectedMonthlyCreditSales"></span>
  367.                             </label> <input tabindex="30" type="text"
  368.                                 wicket:id="customer.kycDetailsBean.expectedMonthlyCreditSales"
  369.                                 id="expectedMonthlyCreditSales" size="20" />
  370.                         </div>
  371.  
  372.                     </div>
  373.  
  374.                 </div>
  375.  
  376.  
  377.                 <!-- Customization for Merchant Account Profile end-->
  378.  
  379.  
  380.  
  381.                 <!-- Customization for Individual Account Profile start-->
  382.  
  383.  
  384.                 <div wicket:id="accountProfileDiv">
  385.  
  386.                     <h2 class="section person">
  387.                         <wicket:message key="accountProfile.headLine" />
  388.                     </h2>
  389.  
  390.                     <div class="column twoColumn">
  391.  
  392.  
  393.                         <div class="input" wicket:id="averageMonthlyInflowDiv">
  394.                             <label for="averageMonthlyInflow"> <wicket:message
  395.                                     key="averageMonthlyInflow" /> <span class="required"
  396.                                 wicket:id="requiredAverageMonthlyInflow"></span>
  397.                             </label> <input tabindex="31" type="text"
  398.                                 wicket:id="customer.kycDetailsBean.averageMonthlyInflow"
  399.                                 id="averageMonthlyInflow" size="20" />
  400.                         </div>
  401.  
  402.                         <div class="input" wicket:id="avergaeYearlyIncomeDiv">
  403.                             <label for="avergaeYearlyIncome"> <wicket:message
  404.                                     key="avergaeYearlyIncome" /> <span class="required"
  405.                                 wicket:id="requiredAvergaeYearlyIncome"></span>
  406.                             </label> <input tabindex="32" type="text"
  407.                                 wicket:id="customer.kycDetailsBean.avergaeYearlyIncome"
  408.                                 id="avergaeYearlyIncome" size="20" />
  409.                         </div>
  410.                     </div>
  411.  
  412.  
  413.                     <div class="column twoColumn">
  414.  
  415.                         <div class="input" wicket:id="averageMonthlyOutflowDiv">
  416.                             <label for="averageMonthlyOutflow"> <wicket:message
  417.                                     key="averageMonthlyOutflow" /> <span class="required"
  418.                                 wicket:id="requiredAverageMonthlyOutflow"></span>
  419.                             </label> <input tabindex="33" type="text"
  420.                                 wicket:id="customer.kycDetailsBean.averageMonthlyOutflow"
  421.                                 id="averageMonthlyOutflow" size="20" />
  422.                         </div>
  423.  
  424.                         <div class="input" wicket:id="averageYearlySalesDiv">
  425.                             <label for="averageYearlySales"> <wicket:message
  426.                                     key="averageYearlySales" /> <span class="required"
  427.                                 wicket:id="requiredAverageYearlySales"></span>
  428.                             </label> <input tabindex="34" type="text"
  429.                                 wicket:id="customer.kycDetailsBean.averageYearlySales"
  430.                                 id="averageYearlySales" size="20" />
  431.                         </div>
  432.  
  433.                     </div>
  434.  
  435.                 </div>
  436.  
  437.  
  438.  
  439.                 <!-- Customization for Individual Account Profile end-->
  440.  
  441.  
  442.  
  443.  
  444.                 <div class="column buffer"></div>
  445.                 <!-- This is the section for KYC -->
  446.  
  447.                 <div wicket:id="kycDiv">
  448.  
  449.                     <h2 class="section person">
  450.                         <wicket:message key="kycInfo.headLine" />
  451.                     </h2>
  452.                    
  453.                     <div class="column twoColumn">
  454.  
  455.                         <div class="input" wicket:id="typeOfCustomer_NotCustomerTypeDiv"
  456.                             style="width: 565px;">
  457.                             <label for="typeOfCustomer_NotCustomerType"> <wicket:message
  458.                                     key="typeOfCustomer_NotCustomerType" /> <span class="required"
  459.                                 wicket:id="requiredTypeOfCustomer_NotCustomerType"></span>
  460.                             </label> <select tabindex="35"
  461.                                 wicket:id="customer.kycDetailsBean.typeOfCustomer_NotCustomerType"
  462.                                 id="typeOfCustomer_NotCustomerType">
  463.                                 <option>dummy</option>
  464.                             </select>
  465.                         </div>
  466.                        
  467.                         <div class="input" wicket:id="bankRecognitionMediumDiv"
  468.                             style="width: 565px;">
  469.                             <label for="bankRecognitionMedium"> <wicket:message
  470.                                     key="bankRecognitionMedium" /> <span class="required"
  471.                                 wicket:id="requiredBankRecognitionMedium"></span>
  472.                             </label> <select tabindex="36"
  473.                                 wicket:id="customer.kycDetailsBean.bankRecognitionMedium"
  474.                                 id="bankRecognitionMedium">
  475.                                 <option>dummy</option>
  476.                             </select>
  477.                         </div>
  478.  
  479.  
  480.                         <div class="input" style="width: 565px;">
  481.                             <label for="isBeneficialAccountOwner"> <wicket:message
  482.                                     key="isBeneficialAccountOwner" /> <span class="required"
  483.                                 wicket:id="requiredIsBeneficialAccountOwner"></span>
  484.                             </label> <select tabindex="37"
  485.                                 wicket:id="customer.kycDetailsBean.isBeneficialAccountOwner"
  486.                                 id="isBeneficialAccountOwner">
  487.                                 <option>dummy</option>
  488.                             </select>
  489.                         </div>
  490.  
  491.                         <div class="input" wicket:id="accountTypeDiv">
  492.                             <label for="accountType"><wicket:message key="accountType" /><span
  493.                                 class="required">*</span></label> <select tabindex="47"
  494.                                 wicket:id="customer.kycDetailsBean.accountType" id="accountType">
  495.                                 <option>dummy</option>
  496.                             </select>
  497.                         </div>
  498.                     </div>
  499.  
  500.                     <div class="column twoColumn">
  501.  
  502.                         <div class="input" wicket:id="purposeOfAccountDiv"
  503.                             style="width: 565px;">
  504.                             <label for="purposeOfAccount"> <wicket:message
  505.                                     key="purposeOfAccount" /> <span class="required"
  506.                                 wicket:id="requiredPurposeOfAccount"></span>
  507.                             </label> <select tabindex="38"
  508.                                 wicket:id="customer.kycDetailsBean.purposeOfAccount"
  509.                                 id="purposeOfAccount">
  510.                                 <option>dummy</option>
  511.                             </select>
  512.                         </div>
  513.  
  514.  
  515.                         <div class="input" wicket:id="modeOfTransactionDiv"
  516.                             style="width: 565px;">
  517.                             <label for="modeOfTransaction"> <wicket:message
  518.                                     key="modeOfTransaction" /> <span class="required"
  519.                                 wicket:id="requiredModeOfTransaction"></span>
  520.                             </label> <select tabindex="39"
  521.                                 wicket:id="customer.kycDetailsBean.modeOfTransaction"
  522.                                 id="modeOfTransaction">
  523.                                 <option>dummy</option>
  524.                             </select>
  525.                         </div>
  526.  
  527.                         <div class="input" wicket:id="sourceOfIncomeDiv">
  528.                             <label for="sourceOfIncome"> <wicket:message
  529.                                     key="sourceOfIncome" /> <span class="required"
  530.                                 wicket:id="requiredSourceOfIncome"></span>
  531.                             </label> <input tabindex="40" type="text"
  532.                                 wicket:id="customer.kycDetailsBean.sourceOfIncome"
  533.                                 id="sourceOfIncome" size="20" />
  534.                         </div>
  535.  
  536.                     </div>
  537.  
  538.                     <!-- <div class="column buffer"></div> -->
  539.                     <!-- This is the section for beneficial account owner -->
  540.                     <div class="column buffer"></div>
  541.                     <div class="column twoColumn">
  542.  
  543.                         <div class="input" wicket:id="salaryDiv">
  544.                             <label for="salary"> <wicket:message key="salary" />
  545.                             </label> <input tabindex="41" type="text"
  546.                                 wicket:id="customer.kycDetailsBean.salary" id="salary" size="20" />
  547.                         </div>
  548.  
  549.                         <div class="input" wicket:id="otherIncomeDiv">
  550.                             <label for="otherIncome"> <wicket:message key="otherIncome" />
  551.                             </label> <input tabindex="42" type="text"
  552.                                 wicket:id="customer.kycDetailsBean.otherIncome" id="otherIncome"
  553.                                 size="20" />
  554.                         </div>
  555.  
  556.                         <div class="input" wicket:id="actualBeneficialOwnerDiv">
  557.                             <label for="actualBeneficialOwner"> <wicket:message
  558.                                     key="actualBeneficialOwner" /> <span class="required"
  559.                                 wicket:id="requiredActualBeneficialOwner"></span>
  560.                             </label> <input tabindex="43" type="text"
  561.                                 wicket:id="customer.kycDetailsBean.actualBeneficialOwner"
  562.                                 id="actualBeneficialOwner" size="20" />
  563.                         </div>
  564.  
  565.                         <div class="input" wicket:id="cnicBeneficialDiv">
  566.                             <label for="cnicBeneficial"> <wicket:message
  567.                                     key="cnicBeneficial" />
  568.                             </label> <input tabindex="44" type="text"
  569.                                 wicket:id="customer.kycDetailsBean.cnicBeneficial"
  570.                                 id="cnicBeneficial" size="20" maxlength="15" />
  571.                         </div>
  572.  
  573.                         <div class="input" wicket:id="currentBusinessSinceDiv">
  574.                             <label for="currentBusinessSince"> <wicket:message
  575.                                     key="currentBusinessSince" /> <span
  576.                                         class="required" wicket:id="requiredCurrentBusinessSince"></span>
  577.                             </label> <input tabindex="45" type="text"
  578.                                 wicket:id="customer.kycDetailsBean.currentBusinessSince"
  579.                                 id="currentBusinessSince" size="20" />
  580.                         </div>
  581.  
  582.                     </div>
  583.  
  584.  
  585.                     <div class="column twoColumn">
  586.  
  587.  
  588.                         <div class="input" wicket:id="typeOfTransactionDiv">
  589.                             <label for="typeOfTransaction"> <wicket:message
  590.                                     key="typeOfTransaction" /> <span
  591.                                         class="required" wicket:id="requiredTypeOfTransaction"></span>
  592.                             </label> <input tabindex="46" type="text"
  593.                                 wicket:id="customer.kycDetailsBean.typeOfTransaction"
  594.                                 id="typeOfTransaction" size="20" />
  595.                         </div>
  596.  
  597.                         <div class="input" wicket:id="premisesDiv">
  598.                             <label for="premises"><wicket:message key="premises" /><span
  599.                                 class="required">*</span></label> <select tabindex="47"
  600.                                 wicket:id="customer.kycDetailsBean.premises" id="premises">
  601.                                 <option>dummy</option>
  602.                             </select>
  603.                         </div>
  604.  
  605.  
  606.                         <div class="input" wicket:id="relationWithApplicantDiv">
  607.                             <label for="relationWithApplicant"> <wicket:message
  608.                                     key="relationWithApplicant" />
  609.                             </label> <input tabindex="48" type="text"
  610.                                 wicket:id="customer.kycDetailsBean.relationWithApplicant"
  611.                                 id="relationWithApplicant" size="20" />
  612.                         </div>
  613.  
  614.                     </div>
  615.  
  616.  
  617.                     <div class="column buffer"></div>
  618.                     <!-- This is the section for Risk Rating -->
  619.                     <h2 class="section person">
  620.                         <wicket:message key="riskProfile.headLine" />
  621.                     </h2>
  622.                     <!-- <div class="column twoColumn"> -->
  623.                     <div class="column" style="padding-left: 6px">
  624.  
  625.                         <div class="input" style="width: 1000px">
  626.                             <label for="accRelegiousOrgOrMadrassa" style="width: 515px">
  627.                                 <wicket:message key="accRelegiousOrgOrMadrassa" /> <span
  628.                                 class="required" wicket:id="requiredAccRelegiousOrgOrMadrassa"></span>
  629.                             </label> <select tabindex="49"
  630.                                 wicket:id="customer.kycDetailsBean.accRelegiousOrgOrMadrassa"
  631.                                 id="accRelegiousOrgOrMadrassa">
  632.                                 <option>dummy</option>
  633.                             </select>
  634.                         </div>
  635.  
  636.  
  637.  
  638.                         <div class="input" style="width: 1000px">
  639.                             <label for="politicalyExposed " style="width: 515px"> <wicket:message
  640.                                     key="politicalyExposed" /> <span class="required"
  641.                                 wicket:id="requiredPoliticalyExposed"></span>
  642.                             </label> <select tabindex="50"
  643.                                 wicket:id="customer.kycDetailsBean.politicalyExposed"
  644.                                 id="politicalyExposed">
  645.                                 <option>dummy</option>
  646.                             </select>
  647.                         </div>
  648.  
  649.  
  650.                         <div class="input" style="width: 1000px">
  651.                             <label for="landLord" style="width: 515px"> <wicket:message
  652.                                     key="landLord" /> <span class="required"
  653.                                 wicket:id="requiredLandLord"></span>
  654.                             </label> <select tabindex="51"
  655.                                 wicket:id="customer.kycDetailsBean.landLord" id="landLord">
  656.                                 <option>dummy</option>
  657.                             </select>
  658.                         </div>
  659.  
  660.  
  661.                         <div class="input" style="width: 1000px">
  662.                             <label for="refusedByOtherBank" style="width: 515px"> <wicket:message
  663.                                     key="refusedByOtherBank" /> <span class="required"
  664.                                 wicket:id="requiredRefusedByOtherBank"></span>
  665.                             </label> <select tabindex="52"
  666.                                 wicket:id="customer.kycDetailsBean.refusedByOtherBank"
  667.                                 id="refusedByOtherBank">
  668.                                 <option>dummy</option>
  669.                             </select>
  670.                         </div>
  671.  
  672.  
  673.                         <div class="input" style="width: 1000px">
  674.                             <label for="dealingWithHighLowRiskCountry" style="width: 515px">
  675.                                 <wicket:message key="dealingWithHighLowRiskCountry" /> <span
  676.                                 class="required"
  677.                                 wicket:id="requiredDealingWithHighLowRiskCountry"></span>
  678.                             </label> <select tabindex="53"
  679.                                 wicket:id="customer.kycDetailsBean.dealingWithHighLowRiskCountry"
  680.                                 id="dealingWithHighLowRiskCountry">
  681.                                 <option>dummy</option>
  682.                             </select>
  683.                         </div>
  684.  
  685.  
  686.                         <div class="input" style="width: 1000px">
  687.                             <label for="customerResident" style="width: 515px"> <wicket:message
  688.                                     key="customerResident" /> <span class="required"
  689.                                 wicket:id="requiredCustomerResident"></span>
  690.                             </label> <select tabindex="54"
  691.                                 wicket:id="customer.kycDetailsBean.customerResident"
  692.                                 id="customerResident">
  693.                                 <option>dummy</option>
  694.                             </select>
  695.                         </div>
  696.  
  697.  
  698.                         <div class="input" style="width: 1000px">
  699.                             <label for="customerActualOwnerOfAcc" style="width: 515px">
  700.                                 <wicket:message key="customerActualOwnerOfAcc" /> <span
  701.                                 class="required" wicket:id="requiredCustomerActualOwnerOfAcc"></span>
  702.                             </label> <select tabindex="55"
  703.                                 wicket:id="customer.kycDetailsBean.customerActualOwnerOfAcc"
  704.                                 id="customerActualOwnerOfAcc">
  705.                                 <option>dummy</option>
  706.                             </select>
  707.                         </div>
  708.  
  709.                     </div>
  710.  
  711.                         <div class="column buffer"></div>
  712.                         <!-- <div class="column twoColumn"> -->
  713.                         <div class="column" style="padding-left: 6px">
  714.  
  715.                             <div class="input" style="width: 1000px">
  716.                                 <label for="customerAsDirectorOrGovBody" style="width: 515px">
  717.                                     <wicket:message key="customerAsDirectorOrGovBody" /> <span
  718.                                     class="required"
  719.                                     wicket:id="requiredCustomerAsDirectorOrGovBody"></span>
  720.                                 </label> <select tabindex="57"
  721.                                     wicket:id="customer.kycDetailsBean.customerAsDirectorOrGovBody"
  722.                                     id="customerAsDirectorOrGovBody">
  723.                                     <option>dummy</option>
  724.                                 </select>
  725.                             </div>
  726.  
  727.  
  728.                             <div class="input" style="width: 1000px">
  729.                                 <label for="houseWife" style="width: 515px"> <wicket:message
  730.                                         key="houseWife" /> <span class="required"
  731.                                     wicket:id="requiredHouseWife"></span>
  732.                                 </label> <select tabindex="58"
  733.                                     wicket:id="customer.kycDetailsBean.houseWife" id="houseWife">
  734.                                     <option>dummy</option>
  735.                                 </select>
  736.                             </div>
  737.  
  738.                             <div class="input" style="width: 1000px">
  739.                                 <label for="customerMinorAccount" style="width: 515px">
  740.                                     <wicket:message key="customerMinorAccount" /> <span
  741.                                     class="required" wicket:id="requiredCustomerMinorAccount"></span>
  742.                                 </label> <select tabindex="59"
  743.                                     wicket:id="customer.kycDetailsBean.customerMinorAccount"
  744.                                     id="customerMinorAccount">
  745.                                     <option>dummy</option>
  746.                                 </select>
  747.                             </div>
  748.  
  749.                             <div class="input" style="width: 1000px">
  750.                                 <label for="customerProfesion" style="width: 515px"> <wicket:message
  751.                                         key="customerProfesion" /> <span class="required"
  752.                                     wicket:id="requiredCustomerProfesion"></span>
  753.                                 </label> <select tabindex="60"
  754.                                     wicket:id="customer.kycDetailsBean.customerProfesion"
  755.                                     id="customerProfesion">
  756.                                     <option>dummy</option>
  757.                                 </select>
  758.                             </div>
  759.  
  760.                             <div class="input" style="width: 1000px">
  761.                                 <label for="productAndServiceMappingMatch" style="width: 515px">
  762.                                     <wicket:message key="productAndServiceMappingMatch" /> <span
  763.                                     class="required"
  764.                                     wicket:id="requiredProductAndServiceMappingMatch"></span>
  765.                                 </label> <select tabindex="61"
  766.                                     wicket:id="customer.kycDetailsBean.productAndServiceMappingMatch"
  767.                                     id="productAndServiceMappingMatch">
  768.                                     <option>dummy</option>
  769.                                 </select>
  770.                             </div>
  771.  
  772.                             <div class="input" style="width: 1000px">
  773.                                 <label for="customerbusinessStructure" style="width: 515px">
  774.                                     <wicket:message key="customerbusinessStructure" /> <span
  775.                                     class="required" wicket:id="requiredCustomerbusinessStructure"></span>
  776.                                 </label> <select tabindex="62"
  777.                                     wicket:id="customer.kycDetailsBean.customerbusinessStructure"
  778.                                     id="customerbusinessStructure">
  779.                                     <option>dummy</option>
  780.                                 </select>
  781.                             </div>
  782.  
  783.                             <div class="input" style="width: 1000px">
  784.                                 <label for="customerHoldMall" style="width: 515px"> <wicket:message
  785.                                         key="customerHoldMall" /> <span class="required"
  786.                                     wicket:id="requiredCustomerHoldMall"></span> <!-- <span class="required">*</span> -->
  787.                                 </label> <select tabindex="63"
  788.                                     wicket:id="customer.kycDetailsBean.customerHoldMall"
  789.                                     id="customerHoldMall">
  790.                                     <option>dummy</option>
  791.                                 </select>
  792.                             </div>
  793.  
  794.                             <div class="column buffer"></div>
  795.  
  796.                             <div class="input" style="width: 1000px">
  797.                                 <label for="riskRating" style="width: 515px"> <wicket:message
  798.                                         key="riskRating" /> <span class="required"
  799.                                     wicket:id="requiredRiskRating"></span>
  800.                                 </label> <select tabindex="56"
  801.                                     wicket:id="customer.kycDetailsBean.riskRating" id="riskRating">
  802.                                     <option>dummy</option>
  803.                                 </select>
  804.                             </div>
  805.                         </div>
  806.  
  807.  
  808.  
  809.  
  810.  
  811.  
  812.                         <div class="column buffer"></div>
  813.                         <!-- This is the section for Additional Comments -->
  814.  
  815.  
  816.                         <div class="column">
  817.  
  818.                             <div class="input">
  819.                                 <label for="textField"> <wicket:message key="textField" />
  820.                                 </label>
  821.                                 <textarea tabindex="64" class="text"
  822.                                     wicket:id="customer.kycDetailsBean.textField" cols="120"
  823.                                     rows="4" id="txnText"></textarea>
  824.                             </div>
  825.                         </div>
  826.                     </div>
  827.  
  828.  
  829.                     <div class="column buffer"></div>
  830.  
  831.                     <div wicket:id="signUpDiv">
  832.  
  833.                         <div class="module clear">
  834.  
  835.                             <h2 class="section customerConfirm">
  836.                                 <wicket:message key="index.headline.confirm" />
  837.                             </h2>
  838.  
  839.                             <div class="column">
  840.  
  841.                                 <p>
  842.                                     <wicket:message key="captcha.help" />
  843.                                 </p>
  844.  
  845.                                 <div class="input"
  846.                                     style="border: 1px #CCCCCC solid; width: 200px;">
  847.                                     <a tabindex="65" wicket:id="captchLink" target="_blank"><img
  848.                                         wicket:id="captchaImage" /></a>
  849.                                 </div>
  850.  
  851.                                 <div class="input" style="width: 448px;">
  852.                                     <label for="captcha"> <wicket:message key="captcha" />
  853.                                         <span class="required">*</span>
  854.                                     </label> <input tabindex="66" type="text" wicket:id="captcha"
  855.                                         id="captcha" size="20" />
  856.                                 </div>
  857.  
  858.                             </div>
  859.  
  860.                         </div>
  861.  
  862.                         <div class="column buffer"></div>
  863.  
  864.                         <div wicket:id="tncsDiv" class="module clear">
  865.  
  866.                             <h2 class="section approval" style="margin-bottom: 5px">
  867.                                 <wicket:message key="terms" />
  868.                             </h2>
  869.  
  870.                             <div class="column">
  871.                                 <ol class="tncsList">
  872.  
  873.                                     <li wicket:id="tncs">
  874.                                         <div wicket:id="conditions" class="tncCondition"></div>
  875.                                         <div class="acknowledgeDiv">
  876.                                             <span wicket:id="asterik">*</span><input type="checkbox"
  877.                                                 wicket:id="selected" /><span class="acknowledgeText">By
  878.                                                 checking this box, you acknowledge accepting the above Terms
  879.                                                 and Conditions.</span>
  880.                                         </div>
  881.                                     </li>
  882.                                 </ol>
  883.  
  884.                             </div>
  885.                         </div>
  886.  
  887.                     </div>
  888.  
  889.  
  890.  
  891.                 </div>
  892.  
  893.                 <div class="column buffer"></div>
  894.  
  895.                 <div class="column">
  896.  
  897.                     <div class="formAction">
  898.  
  899.                         <div wicket:id="cstButtons">
  900.                             <input tabindex="67" type="submit"
  901.                                 class="submitForm defaultAction" wicket:id="register"
  902.                                 wicket:message="value:register" />
  903.                         </div>
  904.                         <div wicket:id="dppButtons">
  905.                             <input type="submit" tabindex="40"
  906.                                 class="submitForm defaultAction" wicket:id="save"
  907.                                 wicket:message="value:register" /> <input type="submit"
  908.                                 tabindex="68" class="submitForm" wicket:id="cancel"
  909.                                 wicket:message="value:Cancel" />
  910.                         </div>
  911.                         <div wicket:id="signupButtons">
  912.                             <input tabindex="69" type="submit"
  913.                                 class="submitForm defaultAction" wicket:id="continue"
  914.                                 wicket:message="value:Continue" /> <input tabindex="70"
  915.                                 type="submit" class="submitForm" wicket:id="back"
  916.                                 wicket:message="value:Back" /> <input tabindex="71"
  917.                                 type="submit" class="submitForm" wicket:id="cancelSignup"
  918.                                 wicket:message="value:Cancel" />
  919.                         </div>
  920.  
  921.                     </div>
  922.  
  923.                 </div>
  924.         </form>
  925.  
  926.     </wicket:panel>
  927.  
  928. </body>
  929. </html>
  930.  
  931.  
  932.  
  933.  
  934.  
  935.  
  936.  
  937.  
  938.  
  939.  
  940.  
  941.  
  942.  
  943.  
  944.  
  945.  
  946.  
  947.  
  948.  
  949.  
  950.  
  951.  
  952.  
  953.  
  954.  
  955.  
  956.  
  957.  
  958.  
  959.  
  960.  
  961.  
  962.  
  963.  
  964.  
  965.  
  966.  
  967.  
  968.  
  969. RegisterCustomerPanel.java:::
  970. ________________________________
  971.  
  972.  
  973.  
  974. package com.sybase365.mobiliser.web.common.panels;
  975.  
  976. import java.util.ArrayList;
  977. import java.util.Calendar;
  978. import java.util.Date;
  979. import java.util.List;
  980.  
  981. import org.apache.wicket.ajax.AjaxRequestTarget;
  982. import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
  983. import org.apache.wicket.ajax.markup.html.AjaxFallbackLink;
  984. import org.apache.wicket.ajax.markup.html.form.AjaxCheckBox;
  985. import org.apache.wicket.behavior.HeaderContributor;
  986. import org.apache.wicket.behavior.SimpleAttributeModifier;
  987. import org.apache.wicket.datetime.PatternDateConverter;
  988. import org.apache.wicket.datetime.markup.html.form.DateTextField;
  989. import org.apache.wicket.markup.ComponentTag;
  990. import org.apache.wicket.markup.html.IHeaderContributor;
  991. import org.apache.wicket.markup.html.IHeaderResponse;
  992. import org.apache.wicket.markup.html.WebMarkupContainer;
  993. import org.apache.wicket.markup.html.WebPage;
  994. import org.apache.wicket.markup.html.basic.Label;
  995. import org.apache.wicket.markup.html.form.Button;
  996. import org.apache.wicket.markup.html.form.Form;
  997. import org.apache.wicket.markup.html.form.RequiredTextField;
  998. import org.apache.wicket.markup.html.form.TextArea;
  999. import org.apache.wicket.markup.html.form.TextField;
  1000. import org.apache.wicket.markup.html.image.NonCachingImage;
  1001. import org.apache.wicket.markup.html.list.ListItem;
  1002. import org.apache.wicket.markup.html.list.ListView;
  1003. import org.apache.wicket.markup.html.panel.FeedbackPanel;
  1004. import org.apache.wicket.markup.html.panel.Panel;
  1005. import org.apache.wicket.model.CompoundPropertyModel;
  1006. import org.apache.wicket.model.IModel;
  1007. import org.apache.wicket.model.Model;
  1008. import org.apache.wicket.model.PropertyModel;
  1009. import org.apache.wicket.spring.injection.annot.SpringBean;
  1010. import org.apache.wicket.validation.validator.EmailAddressValidator;
  1011. import org.apache.wicket.validation.validator.PatternValidator;
  1012. import org.slf4j.Logger;
  1013. import org.slf4j.LoggerFactory;
  1014.  
  1015. import com.sybase365.mobiliser.money.contract.v5_0.customer.beans.Attachment;
  1016. import com.sybase365.mobiliser.money.contract.v5_0.customer.beans.Customer;
  1017. import com.sybase365.mobiliser.money.contract.v5_0.svcpkg.spm.beans.TermAndCondition;
  1018. import com.sybase365.mobiliser.util.contract.v5_0.messaging.beans.Map;
  1019. import com.sybase365.mobiliser.util.contract.v5_0.messaging.beans.Map.Entry;
  1020. import com.sybase365.mobiliser.util.tools.wicketutils.ErrorIndicator;
  1021. import com.sybase365.mobiliser.web.application.clients.CustomClientLogic;
  1022. import com.sybase365.mobiliser.web.application.clients.CustomerClientLogic;
  1023. import com.sybase365.mobiliser.web.application.clients.CustomerSecurityClientLogic;
  1024. import com.sybase365.mobiliser.web.application.clients.MBankingClientLogic;
  1025. import com.sybase365.mobiliser.web.application.clients.MessageClientLogic;
  1026. import com.sybase365.mobiliser.web.application.clients.ServicePackagesClientLogic;
  1027. import com.sybase365.mobiliser.web.application.clients.WalletClientLogic;
  1028. import com.sybase365.mobiliser.web.application.pages.MobiliserBasePage;
  1029. import com.sybase365.mobiliser.web.beans.AddressBean;
  1030. import com.sybase365.mobiliser.web.beans.CustomerBean;
  1031. import com.sybase365.mobiliser.web.common.components.FocusOnLoadBehavior;
  1032. import com.sybase365.mobiliser.web.common.components.FormModificationDetectorBehavior;
  1033. import com.sybase365.mobiliser.web.common.components.LocalizableLookupDropDownChoice;
  1034. import com.sybase365.mobiliser.web.common.components.RenderJavaScriptComponent;
  1035. import com.sybase365.mobiliser.web.common.components.TooltipBehavior;
  1036. import com.sybase365.mobiliser.web.consumer.pages.signup.CaptchaImage;
  1037. import com.sybase365.mobiliser.web.consumer.pages.signup.CaptchaValidator;
  1038. import com.sybase365.mobiliser.web.consumer.pages.signup.ConfirmDataPage;
  1039. import com.sybase365.mobiliser.web.consumer.pages.signup.SignupCancelPage;
  1040. import com.sybase365.mobiliser.web.consumer.pages.signup.SignupStartPage;
  1041. import com.sybase365.mobiliser.web.consumer.pages.signup.TermsAndConditions_en;
  1042. import com.sybase365.mobiliser.web.cst.pages.customercare.StandingDataPage;
  1043. import com.sybase365.mobiliser.web.distributor.pages.customerservices.CustomerDetailsPage;
  1044. import com.sybase365.mobiliser.web.distributor.pages.selfcare.SelfCareHomePage;
  1045. import com.sybase365.mobiliser.web.util.ClientHelper;
  1046. import com.sybase365.mobiliser.web.util.Configuration;
  1047. import com.sybase365.mobiliser.web.util.Constants;
  1048. import com.sybase365.mobiliser.web.util.Converter;
  1049. import com.sybase365.mobiliser.web.util.PhoneNumber;
  1050. import com.sybase365.mobiliser.web.util.PortalUtils;
  1051. import com.sybase365.mobiliser.web.util.ValidationUtils;
  1052.  
  1053. public class RegisterCustomerPanel extends Panel {
  1054.  
  1055.     /**
  1056.      *
  1057.      */
  1058.     private static final long serialVersionUID = 1L;
  1059.  
  1060.     private static final Logger LOG = LoggerFactory
  1061.         .getLogger(RegisterCustomerPanel.class);
  1062.  
  1063.     @SpringBean(name = "configuration")
  1064.     private Configuration configuration;
  1065.  
  1066.     protected MobiliserBasePage basePage;
  1067.     protected CustomerClientLogic selfCustomerClient;
  1068.     protected CustomerClientLogic systemCustomerClient;
  1069.     protected WalletClientLogic selfWalletClient;
  1070.     protected WalletClientLogic systemWalletClient;
  1071.     protected CustomClientLogic systemCustomClient;
  1072.     protected ServicePackagesClientLogic servicePackagesClientLogic;
  1073.     protected CustomerSecurityClientLogic systemCustomerSecurityClient;
  1074.     protected CustomerBean customer;
  1075.     protected String pinConfirmed;
  1076.     protected String passwordConfirmed;
  1077.     protected String captcha;
  1078.     protected AttachmentsPanel attachmentsPanel;
  1079.     protected NonCachingImage captchaImage;
  1080.     List<TermAndCondition> listTermAndCondition;
  1081.     @SuppressWarnings("rawtypes")
  1082.     protected RequiredTextField captchTextField;
  1083.     protected String conditions;
  1084.     protected boolean selected;
  1085.     List<TermAndCondition> selectedTermAndConditions = new ArrayList<TermAndCondition>();
  1086.     List<TermAndCondition> requiredTermAndConditions = new ArrayList<TermAndCondition>();
  1087.     protected String challengeId;
  1088.     @SpringBean(name = "systemAuthMBankingClientLogic")
  1089.     protected MBankingClientLogic clientLogic;
  1090.    
  1091.    
  1092.     private boolean returnPageStatus;
  1093.    
  1094.    
  1095.     protected MessageClientLogic systemMessageClient; // customization by Nouman Zaidi for Notifications
  1096.  
  1097.     public RegisterCustomerPanel(String id, MobiliserBasePage basePage,
  1098.             CustomerClientLogic selfCustomerClient,
  1099.             CustomerClientLogic systemCustomerClient,
  1100.             WalletClientLogic selfWalletClient,
  1101.             WalletClientLogic systemWalletClient,
  1102.             CustomClientLogic systemCustomClient,
  1103.             ServicePackagesClientLogic servicePackagesClientLogic,
  1104.             CustomerSecurityClientLogic systemCustomerSecurityClient,
  1105.             CustomerBean customer,
  1106.             MessageClientLogic systemMessageClient){// customization by Nouman Zaidi for Notifications
  1107.         this(id, basePage, selfCustomerClient, systemCustomerClient,
  1108.             selfWalletClient, systemWalletClient, systemCustomClient,
  1109.             servicePackagesClientLogic, systemCustomerSecurityClient, null,
  1110.             customer,systemMessageClient);// customization by Nouman Zaidi for Notifications
  1111.         }
  1112.  
  1113.         public RegisterCustomerPanel(String id, MobiliserBasePage basePage,
  1114.             CustomerClientLogic selfCustomerClient,
  1115.             CustomerClientLogic systemCustomerClient,
  1116.             WalletClientLogic selfWalletClient,
  1117.             WalletClientLogic systemWalletClient,
  1118.             CustomClientLogic systemCustomClient,
  1119.             ServicePackagesClientLogic servicePackagesClientLogic,
  1120.             CustomerSecurityClientLogic systemCustomerSecurityClient,
  1121.             AttachmentsPanel attachmentsPanel,
  1122.             CustomerBean customer,
  1123.             MessageClientLogic systemMessageClient) {// customization by Nouman Zaidi for Notifications
  1124.         super(id);
  1125.         this.basePage = basePage;
  1126.         this.attachmentsPanel = attachmentsPanel;
  1127.         this.customer = customer;
  1128.         this.selfCustomerClient = selfCustomerClient;
  1129.         this.systemCustomerClient = systemCustomerClient;
  1130.         this.selfWalletClient = selfWalletClient;
  1131.         this.systemWalletClient = systemWalletClient;
  1132.         this.systemCustomClient = systemCustomClient;
  1133.         this.servicePackagesClientLogic = servicePackagesClientLogic;
  1134.         this.systemCustomerSecurityClient = systemCustomerSecurityClient;
  1135.         this.systemMessageClient = systemMessageClient;// customization by Nouman Zaidi for Notifications
  1136.         LOG.debug("-----1-----New customer type -> {}", customer.getCustomerTypeId());
  1137.         LOG.debug("-----1-----New IdenID -> {}", customer.getIdentityId());
  1138.         LOG.debug("-----1-----New KvIdenType -> {}", customer.getKvIdentityType());
  1139.  
  1140.  
  1141.         final String chooseDtTxt = this.basePage.getLocalizer().getString(
  1142.             "datepicker.chooseDate", basePage);
  1143.  
  1144.         add(new HeaderContributor(new IHeaderContributor() {
  1145.  
  1146.             private static final long serialVersionUID = 1L;
  1147.  
  1148.             @Override
  1149.             public void renderHead(IHeaderResponse response) {
  1150.             captcha = "";
  1151.  
  1152.             // localize the jquery datepicker based on users locale setting
  1153.             // locale specific js includes for datepicker are available at
  1154.             // http://jquery-ui.googlecode.com/svn/trunk/ui/i18n/
  1155.             String localeLang = getLocale().getLanguage().toLowerCase();
  1156.  
  1157.             LOG.debug("Using DatePicker for locale language: {}",
  1158.                 localeLang);
  1159.  
  1160.             response.renderJavascriptReference("scripts/jquery/i18n/jquery.ui.datepicker-en.js");
  1161.             response.renderJavascriptReference("scripts/jquery/jquery.min.js");
  1162.             response.renderJavascriptReference("scripts/jquery/jquery-ui.min.js");
  1163.             response.renderJavascriptReference("scripts/jquery/jquery.maskedinput.js");
  1164.             response.renderJavascriptReference("scripts/jquery/customization.js");
  1165.            
  1166.             RenderJavaScriptComponent renderJavaScriptComponent = new RenderJavaScriptComponent();
  1167.             renderJavaScriptComponent.renderDateComponent(response,
  1168.                 "#birthDate", chooseDtTxt, true);
  1169.             renderJavaScriptComponent.renderDateComponent(response,
  1170.                 "#cnicExpiryDate", chooseDtTxt, true, true);
  1171.  
  1172.  
  1173.             }
  1174.         }));
  1175.        
  1176.         if(PortalUtils.exists(attachmentsPanel)){
  1177.             LOG.info("Setting the Attachment Panel when it is not NULL");
  1178.             this.attachmentsPanel.setOutputMarkupPlaceholderTag(true); 
  1179.         }
  1180.        
  1181.         AddressBean addBean = new AddressBean();
  1182.         this.customer.setAddress(addBean);
  1183.        
  1184.         constructPanel();
  1185.         }
  1186.    
  1187.    
  1188.    
  1189.    
  1190.    
  1191.    
  1192.    
  1193.    
  1194.    
  1195.    
  1196.     @SuppressWarnings("unchecked")
  1197.     protected void constructPanel() {
  1198.     @SuppressWarnings("rawtypes")
  1199.     final Form<?> form = new Form("registerCustomerForm",
  1200.         new CompoundPropertyModel<RegisterCustomerPanel>(this));
  1201.     form.add(new FeedbackPanel("errorMessages").setVisible(!PortalUtils
  1202.         .exists(attachmentsPanel)));
  1203.     form.setMultiPart(true);
  1204.     form.add(new FormModificationDetectorBehavior());
  1205.    
  1206.     RequiredTextField<String> nameAsPerCNIC = new RequiredTextField<String>(
  1207.             "customer.address.nameAsPerCNIC");
  1208.     nameAsPerCNIC.add(new FocusOnLoadBehavior());
  1209.         form.add(nameAsPerCNIC.setRequired(true)
  1210.             .add(new PatternValidator(Constants.REGEX_NAME_AS_PER_CNIC))
  1211.             .add(Constants.mediumStringValidator)
  1212.             .add(Constants.mediumSimpleAttributeModifier)
  1213.             .add(new ErrorIndicator()));
  1214.    
  1215.     final WebMarkupContainer fatherHusbandNameDiv = new WebMarkupContainer("fatherHusbandNameDiv");
  1216.     fatherHusbandNameDiv.add(new TextField<String>("customer.fatherHusbandName")
  1217.         .add(new PatternValidator(Constants.REGEX_COMMENTS))
  1218.         .add(Constants.mediumName30StringValidator)
  1219.         .setRequired(true)
  1220.         .add(Constants.mediumSimple30AttributeModifier)
  1221.         .add(new ErrorIndicator()));
  1222.     fatherHusbandNameDiv.setVisible(true);
  1223.     form.add(fatherHusbandNameDiv);
  1224.     fatherHusbandNameDiv.setOutputMarkupPlaceholderTag(true);
  1225.    
  1226.     final WebMarkupContainer genderDiv = new WebMarkupContainer("genderDiv");
  1227.     final LocalizableLookupDropDownChoice<Integer> gender = (LocalizableLookupDropDownChoice<Integer>)
  1228.             new LocalizableLookupDropDownChoice<Integer>(
  1229.         "customer.address.kvGender", Integer.class,
  1230.         Constants.RESOURCE_BUNDLE_GENDER, this, false, true,
  1231.         basePage.getMobiliserWebSession().getLocale())
  1232.         .setNullValid(false).setRequired(true)
  1233.         .add(new ErrorIndicator());
  1234.     genderDiv.add(gender);
  1235.     form.add(genderDiv);
  1236.    
  1237.     final WebMarkupContainer birthDateDiv = new WebMarkupContainer("birthDateDiv");
  1238.    
  1239.     DateTextField birthDateTextField = new DateTextField("birthDateField", new PropertyModel<Date>(
  1240.             this, "customer.birthDateString"), new PatternDateConverter(Constants.DATE_FORMAT_PATTERN_PARSE, false));
  1241.     birthDateDiv.add(birthDateTextField);
  1242.     birthDateDiv.setOutputMarkupPlaceholderTag(true);
  1243.     form.add(birthDateDiv);
  1244.    
  1245.    
  1246.    
  1247.    
  1248.     WebMarkupContainer customerTypeDiv = new WebMarkupContainer("customerTypeDiv");
  1249.     customerTypeDiv.setVisible(true);
  1250.     List<Integer> typeList = null;
  1251.     try {
  1252.         if(getBasePage().getMobiliserWebSession().getRoles().hasRole(Constants.PRIV_CST_LOGIN)){
  1253.             typeList = ClientHelper.getKeysFromPreferences("cstRegisterCustomerTypes", Integer.class, configuration);  
  1254.         }else{
  1255.             if(getBasePage().getMobiliserWebSession().getRoles().hasRole(Constants.PRIV_HEAD_QUARTER_AGENT )){
  1256.                
  1257.                 if(getBasePage().getMobiliserWebSession().getLoggedInCustomer().getCustomerId() == 500110750L){
  1258.                     LOG.info("This is the case when FINCA Super Agent has logged in");
  1259.                     typeList = ClientHelper.getKeysFromPreferences("dppHeadFINCACustomerType", Integer.class, configuration);
  1260.                 } else{
  1261.                     if(getBasePage().getMobiliserWebSession().getLoggedInCustomer().getCustomerId() == 500278623L){
  1262.                         LOG.info("This is the case when FINJA Super Agent has logged in");
  1263.                         typeList = ClientHelper.getKeysFromPreferences("dppHeadFINJACustomerType", Integer.class, configuration);
  1264.                     } else{
  1265.                         LOG.info("Invalid user has logged in, so need to return here.");
  1266.                         return;
  1267.                     }
  1268.                 }
  1269.             }
  1270.             else{
  1271.                 if(getBasePage().getMobiliserWebSession().getRoles().hasRole(Constants.PRIV_MERCHANT_LOGIN)){
  1272.                     if(customer.isVerified()){
  1273.                         //This means that the call is to create MERCHANT, get the MERCHANT customer Types
  1274.                         typeList = ClientHelper.getKeysFromPreferences("dppRegisterDppCustomerTypes", Integer.class, configuration);
  1275.                     }
  1276.                     else{
  1277.                         //This means that the call is to create CUSTOMER, get the CUSTOMER customer Types
  1278.                         typeList = ClientHelper.getKeysFromPreferences("dppRegisterCustomerTypes", Integer.class, configuration);
  1279.                         attachmentsPanel.setVisible(false);
  1280.                     }
  1281.                 }
  1282.             }
  1283.         }
  1284.     } catch (Exception ex) {
  1285.         LOG.warn("Error in loading cutomer type list from preferences.", ex);
  1286.         return;
  1287.     }
  1288.    
  1289.    
  1290.     final LocalizableLookupDropDownChoice<Integer> customertypes = (LocalizableLookupDropDownChoice<Integer>)
  1291.             new LocalizableLookupDropDownChoice<Integer>(
  1292.         "customer.customerTypeId", Integer.class,
  1293.         Constants.RESOURCE_BUNDLE_CUSTOMER_TYPE, this, false, true,
  1294.         typeList, basePage.getMobiliserWebSession().getLocale())
  1295.         .setNullValid(false).setRequired(true)
  1296.         .add(new ErrorIndicator());
  1297.     customerTypeDiv.add(customertypes);
  1298.     form.add(customerTypeDiv);
  1299.    
  1300.     final WebMarkupContainer motherNameDiv = new WebMarkupContainer("motherNameDiv");
  1301.     motherNameDiv.add(new TextField<String>("customer.motherName")
  1302.         .add(new PatternValidator(Constants.REGEX_COMMENTS))
  1303.         .add(Constants.mediumStringValidator)
  1304.         .setRequired(true)
  1305.         .add(Constants.mediumSimpleAttributeModifier)
  1306.         .add(new ErrorIndicator()));
  1307.     motherNameDiv.setVisible(true);
  1308.     form.add(motherNameDiv);
  1309.     motherNameDiv.setOutputMarkupPlaceholderTag(true);
  1310.    
  1311.     final WebMarkupContainer titleDiv = new WebMarkupContainer("titleDiv");
  1312.     titleDiv.add(new TextField<String>("customer.address.title")
  1313.         .add(new PatternValidator(Constants.REGEX_TITLE))
  1314.         .add(Constants.mediumStringValidator)
  1315.         .add(Constants.mediumSimpleAttributeModifier)
  1316.         .add(new ErrorIndicator()));
  1317.     titleDiv.setVisible(true);
  1318.     form.add(titleDiv);
  1319.     titleDiv.setOutputMarkupPlaceholderTag(true);
  1320.  
  1321.    
  1322.     List<String> languageList = new ArrayList<String>();
  1323.     languageList.add(configuration.getLanguage());
  1324.    
  1325.     //for individual kyc start
  1326.     final WebMarkupContainer placeOfBirthDiv = new WebMarkupContainer("placeOfBirthDiv");
  1327.     placeOfBirthDiv.add(new TextField<String>("customer.address.placeOfBirth")
  1328.         .add(new PatternValidator(Constants.REGEX_FIRSTNAME))
  1329.         .add(Constants.mediumName20StringValidator)
  1330.         .setRequired(true)
  1331.         .add(Constants.mediumSimple20AttributeModifier)
  1332.         .add(new ErrorIndicator()));
  1333.     form.add(placeOfBirthDiv);
  1334.     placeOfBirthDiv.setOutputMarkupPlaceholderTag(true);
  1335.    
  1336.    
  1337.     final WebMarkupContainer permanentAddressDiv = new WebMarkupContainer("permanentAddressDiv");
  1338.     permanentAddressDiv.add(new TextField<String>("customer.address.permanentAddress")
  1339.         .add(new PatternValidator(Constants.REGEX_STRING_ALPHA_NUM_SPACE_COMMA_SLASH_UNDERSCORE_ONLY))
  1340.         .add(Constants.mediumStringValidator)
  1341.         .setRequired(true)
  1342.         .add(Constants.mediumSimpleAttributeModifier)
  1343.         .add(new ErrorIndicator()));
  1344.     form.add(permanentAddressDiv);
  1345.     permanentAddressDiv.setOutputMarkupPlaceholderTag(true);
  1346.    
  1347.    
  1348.     final WebMarkupContainer mailingAddressDiv = new WebMarkupContainer("mailingAddressDiv");
  1349.     mailingAddressDiv.add(new TextField<String>("customer.address.mailingAddress")
  1350.         .add(new PatternValidator(Constants.REGEX_STRING_ALPHA_NUM_SPACE_COMMA_SLASH_UNDERSCORE_ONLY))
  1351.         .add(Constants.mediumStringValidator)
  1352.         .setRequired(true)
  1353.         .add(Constants.mediumSimpleAttributeModifier)
  1354.         .add(new ErrorIndicator()));
  1355.     form.add(mailingAddressDiv);
  1356.     mailingAddressDiv.setOutputMarkupPlaceholderTag(true);
  1357.    
  1358.    
  1359.     final WebMarkupContainer businessAddressDiv = new WebMarkupContainer("businessAddressDiv");
  1360.     businessAddressDiv.add(new TextField<String>("customer.address.businessAddress")
  1361.         .add(new PatternValidator(Constants.REGEX_STRING_ALPHA_NUM_SPACE_COMMA_SLASH_UNDERSCORE_ONLY))
  1362.         .add(Constants.mediumStringValidator)
  1363.         .setRequired(true)
  1364.         .add(Constants.mediumSimpleAttributeModifier)
  1365.         .add(new ErrorIndicator()));
  1366.     form.add(businessAddressDiv);
  1367.     businessAddressDiv.setOutputMarkupPlaceholderTag(true);
  1368.    
  1369.     //For merchant kyc Only start
  1370.    
  1371.     final WebMarkupContainer businessDetailDiv = new WebMarkupContainer(
  1372.             "businessDetailDiv");
  1373.     businessDetailDiv.setVisible(true);
  1374.    
  1375.     final WebMarkupContainer businessNameDiv = new WebMarkupContainer("businessNameDiv");
  1376.     businessNameDiv.add(new TextField<String>("customer.businessName")
  1377.         .add(new PatternValidator(Constants.REGEX_NAME_AS_PER_CNIC))
  1378.         .add(Constants.mediumStringValidator)
  1379.         .setRequired(true)
  1380.         .add(Constants.mediumSimpleAttributeModifier)
  1381.         .add(new ErrorIndicator()));
  1382.     businessDetailDiv.add(businessNameDiv);
  1383.     businessNameDiv.setOutputMarkupPlaceholderTag(true);
  1384.    
  1385.    
  1386.     final WebMarkupContainer ntnNumberDiv = new WebMarkupContainer("ntnNumberDiv");
  1387.     ntnNumberDiv.add(new TextField<String>("customer.ntnNumber")
  1388.         .add(new PatternValidator(Constants.REGEX_NTN))
  1389.         .add(Constants.mediumStringValidator)
  1390.         .setRequired(false)
  1391.         .add(Constants.mediumSimpleAttributeModifier)
  1392.         .add(new ErrorIndicator()));
  1393.    
  1394.     businessDetailDiv.add(ntnNumberDiv);
  1395.     ntnNumberDiv.setOutputMarkupPlaceholderTag(true);
  1396.    
  1397.    
  1398.    
  1399.     form.add(businessDetailDiv);
  1400.     businessDetailDiv.setOutputMarkupPlaceholderTag(true);
  1401.    
  1402.    
  1403.    
  1404.     //For merchant kyc end
  1405.    
  1406.     form.add(new LocalizableLookupDropDownChoice<String>(
  1407.             "customer.address.state", String.class,
  1408.             Constants.RESOURCE_BUNDLE_STATES_CODE, this, false, true,
  1409.             basePage.getMobiliserWebSession().getLocale())
  1410.             .setRequired(true)
  1411.             .add(new ErrorIndicator()));
  1412.    
  1413.     form.add(new TextField<String>("customer.address.city")
  1414.             .setRequired(true)
  1415.             .add(new PatternValidator(Constants.REGEX_CITY))
  1416.             .add(Constants.mediumStringValidator)
  1417.             .add(Constants.mediumSimpleAttributeModifier)
  1418.             .add(new ErrorIndicator()));
  1419.  
  1420.    
  1421.     final WebMarkupContainer msisdnDiv = new WebMarkupContainer("msisdnDiv");
  1422.     msisdnDiv.add(new TextField<String>("customer.msisdn")
  1423.         .add(new PatternValidator(Constants.REGEX_PHONE_NUMBER))
  1424.         .add(Constants.mediumStringValidator)
  1425.         .setRequired(true)
  1426.         .add(Constants.mediumSimpleAttributeModifier)
  1427.         .add(new ErrorIndicator()));
  1428.     msisdnDiv.setVisible(true);
  1429.     msisdnDiv.setOutputMarkupPlaceholderTag(true);
  1430.     form.add(msisdnDiv);
  1431.  
  1432.     final WebMarkupContainer emailDiv = new WebMarkupContainer("emailDiv");
  1433.     emailDiv.add(new TextField<String>("customer.address.email")
  1434.             .setRequired(true).add(EmailAddressValidator.getInstance())
  1435.             .add(Constants.mediumStringValidator)
  1436.             .add(Constants.mediumSimpleAttributeModifier)
  1437.             .add(new ErrorIndicator()));
  1438.    
  1439.     emailDiv.setVisible(true);
  1440.     form.add(emailDiv);
  1441.     emailDiv.setOutputMarkupPlaceholderTag(true);
  1442.    
  1443.  
  1444.     final WebMarkupContainer rolesAndPrivilegesDiv = new WebMarkupContainer("rolesAndPrivilegesDiv");
  1445.     final LocalizableLookupDropDownChoice<Integer> rolesTypes = (LocalizableLookupDropDownChoice<Integer>)
  1446.             new LocalizableLookupDropDownChoice<Integer>(
  1447.         "customer.roles", Integer.class,
  1448.         Constants.RESOURCE_BUNDLE_ROLES_FOR_CST_USERS, this, false, true,
  1449.         basePage.getMobiliserWebSession().getLocale())
  1450.         .setNullValid(false).setRequired(true)
  1451.         .add(new ErrorIndicator());
  1452.     rolesAndPrivilegesDiv.add(rolesTypes);
  1453.     rolesAndPrivilegesDiv.setOutputMarkupPlaceholderTag(true);
  1454.     form.add(rolesAndPrivilegesDiv);
  1455.    
  1456.    
  1457.    
  1458.    
  1459.     WebMarkupContainer infoModeDiv = new WebMarkupContainer("infoModeDiv");
  1460.     infoModeDiv.setVisible(true);
  1461.  
  1462.     final WebMarkupContainer kvInfoModeDiv = new WebMarkupContainer("kvInfoModeDiv");
  1463.     kvInfoModeDiv.setVisible(true);
  1464.    
  1465.     final LocalizableLookupDropDownChoice<Integer> infoModeSMSEmail = (LocalizableLookupDropDownChoice<Integer>)
  1466.             new LocalizableLookupDropDownChoice<Integer>(
  1467.                 "customer.kvInfoMode", Integer.class,
  1468.                 Constants.RESOURCE_BUNDLE_INFO_MODE, this, false, true,
  1469.                 basePage.getMobiliserWebSession().getLocale())
  1470.                 .setNullValid(false).setRequired(true)
  1471.                 .add(new ErrorIndicator());
  1472.    
  1473.     kvInfoModeDiv.add(infoModeSMSEmail);
  1474.     kvInfoModeDiv.setOutputMarkupPlaceholderTag(true);
  1475.     infoModeDiv.add(kvInfoModeDiv);
  1476.    
  1477.     final WebMarkupContainer landLineDiv = new WebMarkupContainer("landLineDiv");
  1478.     landLineDiv.add(new TextField<String>("customer.address.landLine")
  1479.         .add(new PatternValidator(Constants.REGEX_PHONE_NUMBER))
  1480.         .add(Constants.mediumStringValidator)
  1481.         .setRequired(true)
  1482.         .add(Constants.mediumSimpleAttributeModifier)
  1483.         .add(new ErrorIndicator()));
  1484.     landLineDiv.setVisible(true);
  1485.     landLineDiv.setOutputMarkupPlaceholderTag(true);
  1486.     infoModeDiv.add(landLineDiv);
  1487.    
  1488.     final WebMarkupContainer networkProviderDiv = new WebMarkupContainer(
  1489.         "networkProviderDiv");
  1490.  
  1491.     networkProviderDiv.add(new LocalizableLookupDropDownChoice<String>(
  1492.         "customer.networkProvider", String.class, "networkproviders",
  1493.         this, false, true, basePage.getMobiliserWebSession()
  1494.             .getLocale()).setNullValid(false).setRequired(true)
  1495.         .add(new ErrorIndicator()));
  1496.  
  1497.     // network provider selection to be made only for mbanking customer
  1498.     // types
  1499.     if (customer.getCustomerTypeId() != null
  1500.         && customer.getCustomerTypeId().intValue() == Constants.MBANKING_CUSTOMER_TYPE) {
  1501.         networkProviderDiv.setVisible(true);
  1502.     } else {
  1503.         networkProviderDiv.setVisible(false);
  1504.     }
  1505.  
  1506.     infoModeDiv.add(networkProviderDiv);
  1507.     networkProviderDiv.setOutputMarkupPlaceholderTag(true);
  1508.     form.add(infoModeDiv);
  1509.    
  1510.    
  1511.     WebMarkupContainer identityInfoDiv = new WebMarkupContainer("identityInfoDiv");
  1512.     identityInfoDiv.setVisible(true);
  1513.     List<Integer> identityTypeList = null;
  1514.     try {
  1515.         if(getBasePage().getMobiliserWebSession().getRoles().hasRole(Constants.PRIV_CST_LOGIN)){
  1516.             identityTypeList = ClientHelper.getKeysFromPreferences("identityTypes", Integer.class, configuration); 
  1517.         }else{
  1518.             if(getBasePage().getMobiliserWebSession().getRoles().hasRole(Constants.PRIV_HEAD_QUARTER_AGENT )){
  1519.                
  1520.                 identityTypeList = ClientHelper.getKeysFromPreferences("identityTypes", Integer.class, configuration);
  1521.                
  1522.             }
  1523.            
  1524.         }
  1525.     } catch (Exception ex) {
  1526.         LOG.warn("Error in loading identity types list from preferences.", ex);
  1527.         return;
  1528.     }
  1529.  
  1530.     final WebMarkupContainer identityInfoTitleDiv = new WebMarkupContainer("identityInfoTitleDiv");
  1531.     identityInfoDiv.add(identityInfoTitleDiv);
  1532.     identityInfoTitleDiv.setOutputMarkupPlaceholderTag(true);
  1533.    
  1534.     final WebMarkupContainer kvIdentityTypeDiv = new WebMarkupContainer("kvIdentityTypeDiv");
  1535.     final LocalizableLookupDropDownChoice<Integer> identityTypeDropDown = (LocalizableLookupDropDownChoice<Integer>)
  1536.             new LocalizableLookupDropDownChoice<Integer>(
  1537.             "customer.kvIdentityType", Integer.class,
  1538.             Constants.RESOURCE_BUNDLE_IDENTITYTYPES, this, false, true,
  1539.             identityTypeList,
  1540.             basePage.getMobiliserWebSession().getLocale()).setNullValid(true).setRequired(true).add(new ErrorIndicator());
  1541.     kvIdentityTypeDiv.add(identityTypeDropDown);
  1542.     kvIdentityTypeDiv.setOutputMarkupPlaceholderTag(true);
  1543.     identityInfoDiv.add(kvIdentityTypeDiv);
  1544.    
  1545.     final WebMarkupContainer cnicExpiryDateDiv = new WebMarkupContainer("cnicExpiryDateDiv");
  1546.     cnicExpiryDateDiv.add(new DateTextField("cnicExpiryDateField", new PropertyModel<Date>(
  1547.             this, "customer.cnicExpiryDateString"), new PatternDateConverter(
  1548.             Constants.DATE_FORMAT_PATTERN_PARSE, false)).setRequired(true)
  1549.             .add(new ErrorIndicator()));
  1550.     cnicExpiryDateDiv.setOutputMarkupPlaceholderTag(true);
  1551.     identityInfoDiv.add(cnicExpiryDateDiv);
  1552.    
  1553.    
  1554.     final WebMarkupContainer kvIdentityValueDiv = new WebMarkupContainer("kvIdentityValueDiv");
  1555.     final TextField<String> identityValueField = new TextField<String>("customer.identityValue");
  1556.     identityInfoDiv.add(identityValueField
  1557.             .add(new PatternValidator(Constants.REGEX_CNIC))
  1558.             .setRequired(true).add(Constants.stringValidatorCNIC)
  1559.             .add(new ErrorIndicator()));
  1560.     kvIdentityValueDiv.add(identityValueField);
  1561.    
  1562.     identityInfoDiv.add(kvIdentityValueDiv);
  1563.     kvIdentityValueDiv.setOutputMarkupPlaceholderTag(true);
  1564.    
  1565.    
  1566.     form.add(identityInfoDiv); 
  1567.        
  1568.    
  1569.    
  1570.     //customization for Merchant Account Profile start
  1571.    
  1572.     final WebMarkupContainer accountProfileMerchantDiv = new WebMarkupContainer(
  1573.             "accountProfileMerchantDiv");
  1574.     accountProfileMerchantDiv.setVisible(true);
  1575.    
  1576.     final WebMarkupContainer monthlyExpectedDepositDiv = new WebMarkupContainer("monthlyExpectedDepositDiv");
  1577.     monthlyExpectedDepositDiv.add(new TextField<String>("customer.kycDetailsBean.monthlyExpectedDeposit")
  1578.         .setRequired(true)
  1579.         .add(new PatternValidator(Constants.REGEX_AMOUNT_12_0))
  1580.         .add(Constants.mediumStringValidator)
  1581.         .add(Constants.mediumSimpleAttributeModifier)
  1582.         .add(new ErrorIndicator()));
  1583.     //monthlyExpectedDepositDiv.setVisible(false);
  1584.     accountProfileMerchantDiv.add(monthlyExpectedDepositDiv);
  1585.     monthlyExpectedDepositDiv.setOutputMarkupPlaceholderTag(true);
  1586.    
  1587.     final WebMarkupContainer monthlyExpectedWithdrawalDiv = new WebMarkupContainer("monthlyExpectedWithdrawalDiv");
  1588.     monthlyExpectedWithdrawalDiv.add(new TextField<String>("customer.kycDetailsBean.monthlyExpectedWithdrawal")
  1589.         .setRequired(true)
  1590.         .add(new PatternValidator(Constants.REGEX_AMOUNT_12_0))
  1591.         .add(Constants.mediumStringValidator)
  1592.         .add(Constants.mediumSimpleAttributeModifier)
  1593.         .add(new ErrorIndicator()));
  1594.     //monthlyExpectedWithdrawalDiv.setVisible(false);
  1595.     accountProfileMerchantDiv.add(monthlyExpectedWithdrawalDiv);
  1596.     monthlyExpectedWithdrawalDiv.setOutputMarkupPlaceholderTag(true);
  1597.    
  1598.     final WebMarkupContainer expectedAvgBalanceDiv = new WebMarkupContainer("expectedAvgBalanceDiv");
  1599.     expectedAvgBalanceDiv.add(new TextField<String>("customer.kycDetailsBean.expectedAvgBalance")
  1600.         .setRequired(true)
  1601.         .add(new PatternValidator(Constants.REGEX_AMOUNT_12_0))
  1602.         .add(Constants.mediumStringValidator)
  1603.         .add(Constants.mediumSimpleAttributeModifier)
  1604.         .add(new ErrorIndicator()));
  1605.     //expectedAvgBalanceDiv.setVisible(false);
  1606.     accountProfileMerchantDiv.add(expectedAvgBalanceDiv);
  1607.     expectedAvgBalanceDiv.setOutputMarkupPlaceholderTag(true);
  1608.    
  1609.     final WebMarkupContainer annualTurnoverDiv = new WebMarkupContainer("annualTurnoverDiv");
  1610.     annualTurnoverDiv.add(new TextField<String>("customer.kycDetailsBean.annualTurnover")
  1611.         .setRequired(true)
  1612.         .add(new PatternValidator(Constants.REGEX_AMOUNT_12_0))
  1613.         .add(Constants.mediumStringValidator)
  1614.         .add(Constants.mediumSimpleAttributeModifier)
  1615.         .add(new ErrorIndicator()));
  1616.     //annualTurnoverDiv.setVisible(false);
  1617.     accountProfileMerchantDiv.add(annualTurnoverDiv);
  1618.     annualTurnoverDiv.setOutputMarkupPlaceholderTag(true);
  1619.    
  1620.     final WebMarkupContainer expectedMonthlyCreditSalesDiv = new WebMarkupContainer("expectedMonthlyCreditSalesDiv");
  1621.     expectedMonthlyCreditSalesDiv.add(new TextField<String>("customer.kycDetailsBean.expectedMonthlyCreditSales")
  1622.         .setRequired(true)
  1623.         .add(new PatternValidator(Constants.REGEX_AMOUNT_12_0))
  1624.         .add(Constants.mediumStringValidator)
  1625.         .add(Constants.mediumSimpleAttributeModifier)
  1626.         .add(new ErrorIndicator()));
  1627.     //expectedMonthlyCreditSalesDiv.setVisible(false);
  1628.     accountProfileMerchantDiv.add(expectedMonthlyCreditSalesDiv);
  1629.     expectedMonthlyCreditSalesDiv.setOutputMarkupPlaceholderTag(true);
  1630.    
  1631.     monthlyExpectedDepositDiv.addOrReplace(new Label("requiredMonthlyExpectedDeposit", "*"));
  1632.     monthlyExpectedWithdrawalDiv.addOrReplace(new Label("requiredMonthlyExpectedWithdrawal", "*"));
  1633.     expectedAvgBalanceDiv.addOrReplace(new Label("requiredExpectedAvgBalance", "*"));
  1634.     annualTurnoverDiv.addOrReplace(new Label("requiredAnnualTurnover", "*"));
  1635.     expectedMonthlyCreditSalesDiv.addOrReplace(new Label("requiredExpectedMonthlyCreditSales", "*"));
  1636.    
  1637.    
  1638.    
  1639.     accountProfileMerchantDiv.add(monthlyExpectedDepositDiv);
  1640.     accountProfileMerchantDiv.add(monthlyExpectedWithdrawalDiv);
  1641.     accountProfileMerchantDiv.add(expectedAvgBalanceDiv);
  1642.     accountProfileMerchantDiv.add(annualTurnoverDiv);
  1643.     accountProfileMerchantDiv.add(expectedMonthlyCreditSalesDiv);
  1644.    
  1645.    
  1646.     form.add(accountProfileMerchantDiv);
  1647.     accountProfileMerchantDiv.setOutputMarkupPlaceholderTag(true);
  1648.    
  1649.     //customization for Merchant Account Profile end
  1650.    
  1651.    
  1652.    
  1653.     //customization for Individual Account Profile start
  1654.     final WebMarkupContainer accountProfileDiv = new WebMarkupContainer(
  1655.             "accountProfileDiv");
  1656.     accountProfileDiv.setVisible(true);
  1657.    
  1658.    
  1659.     final WebMarkupContainer averageMonthlyInflowDiv = new WebMarkupContainer("averageMonthlyInflowDiv");
  1660.     averageMonthlyInflowDiv.add(new TextField<String>("customer.kycDetailsBean.averageMonthlyInflow")
  1661.         .setRequired(true)
  1662.         .add(new PatternValidator(Constants.REGEX_AMOUNT_12_0))
  1663.        
  1664.         .add(Constants.mediumStringValidator)
  1665.         .add(Constants.mediumSimpleAttributeModifier)
  1666.         .add(new ErrorIndicator()));
  1667.     //actualBeneficialOwnerDiv.setVisible(false);
  1668.     accountProfileDiv.add(averageMonthlyInflowDiv);
  1669.     averageMonthlyInflowDiv.setOutputMarkupPlaceholderTag(true);
  1670.    
  1671.     final WebMarkupContainer avergaeYearlyIncomeDiv = new WebMarkupContainer("avergaeYearlyIncomeDiv");
  1672.     avergaeYearlyIncomeDiv.add(new TextField<String>("customer.kycDetailsBean.avergaeYearlyIncome")
  1673.         .setRequired(true)
  1674.         .add(new PatternValidator(Constants.REGEX_AMOUNT_12_0))
  1675.         .add(Constants.mediumStringValidator)
  1676.         .add(Constants.mediumSimpleAttributeModifier)
  1677.         .add(new ErrorIndicator()));
  1678.     //actualBeneficialOwnerDiv.setVisible(false);
  1679.     accountProfileDiv.add(avergaeYearlyIncomeDiv);
  1680.     avergaeYearlyIncomeDiv.setOutputMarkupPlaceholderTag(true);
  1681.    
  1682.     final WebMarkupContainer averageMonthlyOutflowDiv = new WebMarkupContainer("averageMonthlyOutflowDiv");
  1683.     averageMonthlyOutflowDiv.add(new TextField<String>("customer.kycDetailsBean.averageMonthlyOutflow")
  1684.         .setRequired(true)
  1685.         .add(new PatternValidator(Constants.REGEX_AMOUNT_12_0))
  1686.         .add(Constants.mediumStringValidator)
  1687.         .add(Constants.mediumSimpleAttributeModifier)
  1688.         .add(new ErrorIndicator()));
  1689.     //actualBeneficialOwnerDiv.setVisible(false);
  1690.     accountProfileDiv.add(averageMonthlyOutflowDiv);
  1691.     averageMonthlyOutflowDiv.setOutputMarkupPlaceholderTag(true);
  1692.    
  1693.     final WebMarkupContainer averageYearlySalesDiv = new WebMarkupContainer("averageYearlySalesDiv");
  1694.     averageYearlySalesDiv.add(new TextField<String>("customer.kycDetailsBean.averageYearlySales")
  1695.         .setRequired(true)
  1696.         .add(new PatternValidator(Constants.REGEX_AMOUNT_12_0))
  1697.         .add(Constants.mediumStringValidator)
  1698.         .add(Constants.mediumSimpleAttributeModifier)
  1699.         .add(new ErrorIndicator()));
  1700.     //actualBeneficialOwnerDiv.setVisible(false);
  1701.     accountProfileDiv.add(averageYearlySalesDiv);
  1702.     averageYearlySalesDiv.setOutputMarkupPlaceholderTag(true);
  1703.    
  1704.     form.add(accountProfileDiv);
  1705.     accountProfileDiv.setOutputMarkupPlaceholderTag(true);
  1706.    
  1707.     //customization for Individual Account Profile end
  1708.        
  1709.    
  1710.    
  1711.    
  1712.     final WebMarkupContainer kycDiv = new WebMarkupContainer("kycDiv");
  1713.     kycDiv.setVisible(true);
  1714.    
  1715.     final WebMarkupContainer typeOfCustomer_NotCustomerTypeDiv = new WebMarkupContainer("typeOfCustomer_NotCustomerTypeDiv");
  1716.     final LocalizableLookupDropDownChoice<Integer> typeOfCustomer_NotCustomerTypeDropDown = new LocalizableLookupDropDownChoice<Integer>(
  1717.             "customer.kycDetailsBean.typeOfCustomer_NotCustomerType", Integer.class,
  1718.             Constants.RESOURCE_BUNDLE_TYPE_OF_CUSTOMER_DESC, this, false, true,
  1719.             basePage.getMobiliserWebSession().getLocale());
  1720.     typeOfCustomer_NotCustomerTypeDiv.add(typeOfCustomer_NotCustomerTypeDropDown.setNullValid(true).setRequired(true).setEnabled(true).add(new ErrorIndicator()));
  1721.     kycDiv.add(typeOfCustomer_NotCustomerTypeDiv);
  1722.     typeOfCustomer_NotCustomerTypeDiv.setOutputMarkupPlaceholderTag(true);
  1723.    
  1724.    
  1725.    
  1726.     final WebMarkupContainer bankRecognitionMediumDiv = new WebMarkupContainer("bankRecognitionMediumDiv");
  1727.     final LocalizableLookupDropDownChoice<Integer> bankRecognitionMedium = new LocalizableLookupDropDownChoice<Integer>(
  1728.             "customer.kycDetailsBean.bankRecognitionMedium", Integer.class,
  1729.             Constants.RESOURCE_BUNDLE_HEARING_MEDIUM, this, false, true,
  1730.             basePage.getMobiliserWebSession().getLocale());
  1731.     bankRecognitionMediumDiv.add(bankRecognitionMedium.setNullValid(true).setRequired(true).setEnabled(true).add(new ErrorIndicator()));
  1732.     kycDiv.add(bankRecognitionMediumDiv);
  1733.     bankRecognitionMediumDiv.setOutputMarkupPlaceholderTag(true);
  1734.    
  1735.    
  1736.     final LocalizableLookupDropDownChoice<Integer> isBeneficialAccountOwner = new LocalizableLookupDropDownChoice<Integer>(
  1737.             "customer.kycDetailsBean.isBeneficialAccountOwner", Integer.class,
  1738.             Constants.RESOURCE_BUNDLE_BINARY_DECISION, this, false, true,
  1739.             basePage.getMobiliserWebSession().getLocale());
  1740.     kycDiv.add(isBeneficialAccountOwner.setNullValid(true).setRequired(true).setEnabled(true).add(new ErrorIndicator()));
  1741.    
  1742.     final WebMarkupContainer purposeOfAccountDiv = new WebMarkupContainer("purposeOfAccountDiv");
  1743.     final LocalizableLookupDropDownChoice<Integer> purposeOfAccount = new LocalizableLookupDropDownChoice<Integer>(
  1744.             "customer.kycDetailsBean.purposeOfAccount", Integer.class,
  1745.             Constants.RESOURCE_BUNDLE_PURPOSE_OF_ACCOUNT, this, false, true,
  1746.             basePage.getMobiliserWebSession().getLocale());
  1747.     purposeOfAccountDiv.add(purposeOfAccount.setNullValid(true).setRequired(true).setEnabled(true).add(new ErrorIndicator()));
  1748.     kycDiv.add(purposeOfAccountDiv);
  1749.     purposeOfAccountDiv.setOutputMarkupPlaceholderTag(true);
  1750.    
  1751.     final WebMarkupContainer modeOfTransactionDiv = new WebMarkupContainer("modeOfTransactionDiv");
  1752.     final LocalizableLookupDropDownChoice<Integer> modeOfTransaction = new LocalizableLookupDropDownChoice<Integer>(
  1753.             "customer.kycDetailsBean.modeOfTransaction", Integer.class,
  1754.             Constants.RESOURCE_BUNDLE_TXN_MODE, this, false, true,
  1755.             basePage.getMobiliserWebSession().getLocale());
  1756.     modeOfTransactionDiv.add(modeOfTransaction.setNullValid(true).setRequired(true).setEnabled(true).add(new ErrorIndicator()));
  1757.     kycDiv.add(modeOfTransactionDiv);
  1758.     modeOfTransactionDiv.setOutputMarkupPlaceholderTag(true);
  1759.    
  1760.     final WebMarkupContainer actualBeneficialOwnerDiv = new WebMarkupContainer("actualBeneficialOwnerDiv");
  1761.     actualBeneficialOwnerDiv.add(new TextField<String>("customer.kycDetailsBean.actualBeneficialOwner")
  1762.         .setRequired(true)
  1763.         .add(new PatternValidator(Constants.REGEX_FIRSTNAME))
  1764.         .add(Constants.mediumStringValidator)
  1765.         .add(Constants.mediumSimpleAttributeModifier)
  1766.         .add(new ErrorIndicator()));
  1767.     actualBeneficialOwnerDiv.setVisible(false);
  1768.     kycDiv.add(actualBeneficialOwnerDiv);
  1769.     actualBeneficialOwnerDiv.setOutputMarkupPlaceholderTag(true);
  1770.    
  1771.     final WebMarkupContainer cnicBeneficialDiv = new WebMarkupContainer("cnicBeneficialDiv");
  1772.     cnicBeneficialDiv.add(new TextField<String>("customer.kycDetailsBean.cnicBeneficial")
  1773.         .setRequired(false)
  1774.         .add(new PatternValidator(Constants.REGEX_CNIC))
  1775.         .add(Constants.mediumStringValidator)
  1776.         .add(Constants.mediumSimpleAttributeModifier)
  1777.         .add(new ErrorIndicator()));
  1778.     actualBeneficialOwnerDiv.setVisible(false);
  1779.     kycDiv.add(cnicBeneficialDiv);
  1780.     cnicBeneficialDiv.setOutputMarkupPlaceholderTag(true);
  1781.    
  1782.     final WebMarkupContainer relationWithApplicantDiv = new WebMarkupContainer("relationWithApplicantDiv");
  1783.     relationWithApplicantDiv.add(new TextField<String>("customer.kycDetailsBean.relationWithApplicant")
  1784.         .setRequired(false)
  1785.         .add(new PatternValidator(Constants.REGEX_FIRSTNAME))
  1786.         .add(Constants.mediumStringValidator)
  1787.         .add(Constants.mediumSimpleAttributeModifier)
  1788.         .add(new ErrorIndicator()));
  1789.     actualBeneficialOwnerDiv.setVisible(false);
  1790.     kycDiv.add(relationWithApplicantDiv);
  1791.     relationWithApplicantDiv.setOutputMarkupPlaceholderTag(true);
  1792.    
  1793.     //customization
  1794.     final WebMarkupContainer sourceOfIncomeDiv = new WebMarkupContainer("sourceOfIncomeDiv");
  1795.     sourceOfIncomeDiv.add(new TextField<String>("customer.kycDetailsBean.sourceOfIncome")
  1796.         .add(new PatternValidator(Constants.REGEX_FIRSTNAME))
  1797.         .add(Constants.mediumName20StringValidator)
  1798.         .setRequired(true)
  1799.         .add(Constants.mediumSimple20AttributeModifier)
  1800.         .add(new ErrorIndicator()));
  1801.     actualBeneficialOwnerDiv.setVisible(false);
  1802.     kycDiv.add(sourceOfIncomeDiv);
  1803.     sourceOfIncomeDiv.setOutputMarkupPlaceholderTag(true);
  1804.    
  1805.     final WebMarkupContainer accountsDiv = new WebMarkupContainer("accountTypeDiv");
  1806.     final LocalizableLookupDropDownChoice<Integer> accountsTypes = (LocalizableLookupDropDownChoice<Integer>)
  1807.             new LocalizableLookupDropDownChoice<Integer>(
  1808.         "customer.kycDetailsBean.accountType", Integer.class,
  1809.         Constants.RESOURCE_BUNDLE_KYC_ACCOUNTS, this, false, true,
  1810.         basePage.getMobiliserWebSession().getLocale())
  1811.         .setNullValid(false).setRequired(true)
  1812.         .add(new ErrorIndicator());
  1813.     accountsDiv.add(accountsTypes);
  1814.     kycDiv.add(accountsDiv);
  1815.     accountsDiv.setOutputMarkupPlaceholderTag(true);
  1816.    
  1817.    
  1818.    
  1819.     final WebMarkupContainer salaryDiv = new WebMarkupContainer("salaryDiv");
  1820.     salaryDiv.add(new TextField<String>("customer.kycDetailsBean.salary")
  1821.         .add(new PatternValidator(Constants.REGEX_AMOUNT_12_0))
  1822.         .add(Constants.mediumName20StringValidator)
  1823.         .setRequired(false)
  1824.         .add(Constants.mediumSimple20AttributeModifier)
  1825.         .add(new ErrorIndicator()));
  1826.     //actualBeneficialOwnerDiv.setVisible(false);
  1827.     kycDiv.add(salaryDiv);
  1828.     salaryDiv.setOutputMarkupPlaceholderTag(true);
  1829.    
  1830.     final WebMarkupContainer otherIncomeDiv = new WebMarkupContainer("otherIncomeDiv");
  1831.     otherIncomeDiv.add(new TextField<String>("customer.kycDetailsBean.otherIncome")
  1832.         .add(new PatternValidator(Constants.REGEX_AMOUNT_12_0))
  1833.         .add(Constants.mediumName20StringValidator)
  1834.         .setRequired(false)
  1835.         .add(Constants.mediumSimple20AttributeModifier)
  1836.         .add(new ErrorIndicator()));
  1837.     //actualBeneficialOwnerDiv.setVisible(false);
  1838.     kycDiv.add(otherIncomeDiv);
  1839.     otherIncomeDiv.setOutputMarkupPlaceholderTag(true);
  1840.    
  1841.     final WebMarkupContainer typeOfTransactionDiv = new WebMarkupContainer("typeOfTransactionDiv");
  1842.     typeOfTransactionDiv.add(new TextField<String>("customer.kycDetailsBean.typeOfTransaction")
  1843.         .add(new PatternValidator(Constants.REGEX_STRING_ALPHA_NUM_SPACE_COMMA_SLASH_UNDERSCORE_ONLY))
  1844.         .add(Constants.mediumName20StringValidator)
  1845.         .setRequired(true)
  1846. //      .setRequired(false)
  1847.         .add(Constants.mediumSimple20AttributeModifier)
  1848.         .add(new ErrorIndicator()));
  1849.     //actualBeneficialOwnerDiv.setVisible(false);
  1850.     kycDiv.add(typeOfTransactionDiv);
  1851.     typeOfTransactionDiv.setOutputMarkupPlaceholderTag(true);
  1852.    
  1853.     final WebMarkupContainer currentBusinessSinceDiv = new WebMarkupContainer("currentBusinessSinceDiv");
  1854.     currentBusinessSinceDiv.add(new TextField<String>("customer.kycDetailsBean.currentBusinessSince")
  1855.         .add(new PatternValidator(Constants.REGEX_STRING_ALPHA_NUM_SPACE_ONLY))
  1856.         .add(Constants.mediumName20StringValidator)
  1857.         .setRequired(true)
  1858. //      .setRequired(false)
  1859.         .add(Constants.mediumSimple20AttributeModifier)
  1860.         .add(new ErrorIndicator()));
  1861.     //actualBeneficialOwnerDiv.setVisible(false);
  1862.     kycDiv.add(currentBusinessSinceDiv);
  1863.     currentBusinessSinceDiv.setOutputMarkupPlaceholderTag(true);
  1864.    
  1865.     final WebMarkupContainer premisesDiv = new WebMarkupContainer("premisesDiv");
  1866.     final LocalizableLookupDropDownChoice<Integer> premisesTypes = (LocalizableLookupDropDownChoice<Integer>)
  1867.             new LocalizableLookupDropDownChoice<Integer>(
  1868.         "customer.kycDetailsBean.premises", Integer.class,
  1869.         Constants.RESOURCE_BUNDLE_KYC_PREMISES, this, false, true,
  1870.         basePage.getMobiliserWebSession().getLocale())
  1871.         .setNullValid(false).setRequired(true)
  1872.         .add(new ErrorIndicator());
  1873.     premisesDiv.add(premisesTypes);
  1874.     kycDiv.add(premisesDiv);
  1875.     premisesDiv.setOutputMarkupPlaceholderTag(true);
  1876.    
  1877.    
  1878.    
  1879.    
  1880.     isBeneficialAccountOwner.add(new AjaxFormComponentUpdatingBehavior("onchange") {
  1881.         private static final long serialVersionUID = 1L;
  1882.  
  1883.         @Override
  1884.         protected void onUpdate(AjaxRequestTarget target) {
  1885.        
  1886.         if(customer != null){
  1887.             if(customer.getKycDetailsBean() != null){
  1888.                 if (customer.getKycDetailsBean().getIsBeneficialAccountOwner() != null){
  1889.                    
  1890.                     switch(customer.getKycDetailsBean().getIsBeneficialAccountOwner().intValue()){
  1891.                     case (Constants.BINARY_DECISION_YES):
  1892.                         actualBeneficialOwnerDiv.setVisible(false);
  1893.                         cnicBeneficialDiv.setVisible(false);
  1894.                         relationWithApplicantDiv.setVisible(false);
  1895.                        
  1896.                         kycDiv.addOrReplace(new Label("requiredActualBeneficialOwner", ""));
  1897.                         kycDiv.addOrReplace(new Label("requiredCnicBeneficial", ""));
  1898.                         kycDiv.addOrReplace(new Label("requiredRelationWithApplicant", ""));
  1899.                    
  1900.                     break;
  1901.                     case (Constants.BINARY_DECISION_NO):
  1902.                         actualBeneficialOwnerDiv.setVisible(true);
  1903.                         cnicBeneficialDiv.setVisible(true);
  1904.                         relationWithApplicantDiv.setVisible(true);
  1905.                        
  1906.                         kycDiv.addOrReplace(new Label("requiredActualBeneficialOwner", "*"));
  1907.                         kycDiv.addOrReplace(new Label("requiredCnicBeneficial", "*"));
  1908.                         kycDiv.addOrReplace(new Label("requiredRelationWithApplicant", "*"));
  1909.                
  1910.                        
  1911.                     break;
  1912.                     default : break;
  1913.                     }
  1914.                    
  1915.                 }
  1916.                 else {
  1917.                    
  1918.                 }  
  1919.                 target.addComponent(actualBeneficialOwnerDiv);
  1920.                 target.addComponent(cnicBeneficialDiv);
  1921.                 target.addComponent(relationWithApplicantDiv);
  1922.                 }
  1923.             }
  1924.         }  
  1925.            
  1926.        
  1927.     });
  1928.    
  1929.    
  1930.    
  1931.     final LocalizableLookupDropDownChoice<Integer> accRelegiousOrgOrMadrassa = new LocalizableLookupDropDownChoice<Integer>(
  1932.             "customer.kycDetailsBean.accRelegiousOrgOrMadrassa", Integer.class,
  1933.             Constants.RESOURCE_BUNDLE_HIGH_LOW_RISK, this, false, true,
  1934.             basePage.getMobiliserWebSession().getLocale());
  1935.     kycDiv.add(accRelegiousOrgOrMadrassa.setNullValid(true).setRequired(true).setEnabled(true).add(new ErrorIndicator()));
  1936.    
  1937.     final LocalizableLookupDropDownChoice<Integer> customerAsDirectorOrGovBody = new LocalizableLookupDropDownChoice<Integer>(
  1938.             "customer.kycDetailsBean.customerAsDirectorOrGovBody", Integer.class,
  1939.             Constants.RESOURCE_BUNDLE_HIGH_LOW_RISK, this, false, true,
  1940.             basePage.getMobiliserWebSession().getLocale());
  1941.     kycDiv.add(customerAsDirectorOrGovBody.setNullValid(true).setRequired(true).setEnabled(true).add(new ErrorIndicator()));
  1942.    
  1943.     final LocalizableLookupDropDownChoice<Integer> politicalyExposed = new LocalizableLookupDropDownChoice<Integer>(
  1944.             "customer.kycDetailsBean.politicalyExposed", Integer.class,
  1945.             Constants.RESOURCE_BUNDLE_HIGH_LOW_RISK, this, false, true,
  1946.             basePage.getMobiliserWebSession().getLocale());
  1947.     kycDiv.add(politicalyExposed.setNullValid(true).setRequired(true).setEnabled(true).add(new ErrorIndicator()));
  1948.    
  1949.     final LocalizableLookupDropDownChoice<Integer> houseWife = new LocalizableLookupDropDownChoice<Integer>(
  1950.             "customer.kycDetailsBean.houseWife", Integer.class,
  1951.             Constants.RESOURCE_BUNDLE_HIGH_LOW_RISK, this, false, true,
  1952.             basePage.getMobiliserWebSession().getLocale());
  1953.     kycDiv.add(houseWife.setNullValid(true).setRequired(true).setEnabled(true).add(new ErrorIndicator()));
  1954.    
  1955.     final LocalizableLookupDropDownChoice<Integer> landLord = new LocalizableLookupDropDownChoice<Integer>(
  1956.             "customer.kycDetailsBean.landLord", Integer.class,
  1957.             Constants.RESOURCE_BUNDLE_HIGH_LOW_RISK, this, false, true,
  1958.             basePage.getMobiliserWebSession().getLocale());
  1959.     kycDiv.add(landLord.setNullValid(true).setRequired(true).setEnabled(true).add(new ErrorIndicator()));
  1960.    
  1961.     final LocalizableLookupDropDownChoice<Integer> customerMinorAccount = new LocalizableLookupDropDownChoice<Integer>(
  1962.             "customer.kycDetailsBean.customerMinorAccount", Integer.class,
  1963.             Constants.RESOURCE_BUNDLE_HIGH_LOW_RISK, this, false, true,
  1964.             basePage.getMobiliserWebSession().getLocale());
  1965.     kycDiv.add(customerMinorAccount.setNullValid(true).setRequired(true).setEnabled(true).add(new ErrorIndicator()));
  1966.    
  1967.     final LocalizableLookupDropDownChoice<Integer> refusedByOtherBank = new LocalizableLookupDropDownChoice<Integer>(
  1968.             "customer.kycDetailsBean.refusedByOtherBank", Integer.class,
  1969.             Constants.RESOURCE_BUNDLE_HIGH_LOW_RISK, this, false, true,
  1970.             basePage.getMobiliserWebSession().getLocale());
  1971.     kycDiv.add(refusedByOtherBank.setNullValid(true).setRequired(true).setEnabled(true).add(new ErrorIndicator()));
  1972.    
  1973.     final LocalizableLookupDropDownChoice<Integer> customerProfesion = new LocalizableLookupDropDownChoice<Integer>(
  1974.             "customer.kycDetailsBean.customerProfesion", Integer.class,
  1975.             Constants.RESOURCE_BUNDLE_HIGH_LOW_RISK, this, false, true,
  1976.             basePage.getMobiliserWebSession().getLocale());
  1977.     kycDiv.add(customerProfesion.setNullValid(true).setRequired(true).setEnabled(true).add(new ErrorIndicator()));
  1978.    
  1979.     final LocalizableLookupDropDownChoice<Integer> dealingWithHighLowRiskCountry = new LocalizableLookupDropDownChoice<Integer>(
  1980.             "customer.kycDetailsBean.dealingWithHighLowRiskCountry", Integer.class,
  1981.             Constants.RESOURCE_BUNDLE_HIGH_LOW_RISK, this, false, true,
  1982.             basePage.getMobiliserWebSession().getLocale());
  1983.     kycDiv.add(dealingWithHighLowRiskCountry.setNullValid(true).setRequired(true).setEnabled(true).add(new ErrorIndicator()));
  1984.    
  1985.     final LocalizableLookupDropDownChoice<Integer> productAndServiceMappingMatch = new LocalizableLookupDropDownChoice<Integer>(
  1986.             "customer.kycDetailsBean.productAndServiceMappingMatch", Integer.class,
  1987.             Constants.RESOURCE_BUNDLE_HIGH_LOW_RISK, this, false, true,
  1988.             basePage.getMobiliserWebSession().getLocale());
  1989.     kycDiv.add(productAndServiceMappingMatch.setNullValid(true).setRequired(true).setEnabled(true).add(new ErrorIndicator()));
  1990.    
  1991.     final LocalizableLookupDropDownChoice<Integer> customerResident = new LocalizableLookupDropDownChoice<Integer>(
  1992.             "customer.kycDetailsBean.customerResident", Integer.class,
  1993.             Constants.RESOURCE_BUNDLE_HIGH_LOW_RISK, this, false, true,
  1994.             basePage.getMobiliserWebSession().getLocale());
  1995.     kycDiv.add(customerResident.setNullValid(true).setRequired(true).setEnabled(true).add(new ErrorIndicator()));
  1996.    
  1997.     final LocalizableLookupDropDownChoice<Integer> customerbusinessStructure = new LocalizableLookupDropDownChoice<Integer>(
  1998.             "customer.kycDetailsBean.customerbusinessStructure", Integer.class,
  1999.             Constants.RESOURCE_BUNDLE_HIGH_LOW_RISK, this, false, true,
  2000.             basePage.getMobiliserWebSession().getLocale());
  2001.     kycDiv.add(customerbusinessStructure.setNullValid(true).setRequired(true).setEnabled(true).add(new ErrorIndicator()));
  2002.    
  2003.     final LocalizableLookupDropDownChoice<Integer> customerActualOwnerOfAcc = new LocalizableLookupDropDownChoice<Integer>(
  2004.             "customer.kycDetailsBean.customerActualOwnerOfAcc", Integer.class,
  2005.             Constants.RESOURCE_BUNDLE_HIGH_LOW_RISK, this, false, true,
  2006.             basePage.getMobiliserWebSession().getLocale());
  2007.     kycDiv.add(customerActualOwnerOfAcc.setNullValid(true).setRequired(true).setEnabled(true).add(new ErrorIndicator()));
  2008.    
  2009.     final LocalizableLookupDropDownChoice<Integer> customerHoldMall = new LocalizableLookupDropDownChoice<Integer>(
  2010.             "customer.kycDetailsBean.customerHoldMall", Integer.class,
  2011.             Constants.RESOURCE_BUNDLE_HIGH_LOW_RISK, this, false, true,
  2012.             basePage.getMobiliserWebSession().getLocale());
  2013.     kycDiv.add(customerHoldMall.setNullValid(true).setRequired(true).setEnabled(true).add(new ErrorIndicator()));
  2014.    
  2015.     final LocalizableLookupDropDownChoice<Integer> riskRating = new LocalizableLookupDropDownChoice<Integer>(
  2016.             "customer.kycDetailsBean.riskRating", Integer.class,
  2017.             Constants.RESOURCE_BUNDLE_HIGH_LOW_RISK, this, false, true,
  2018.             basePage.getMobiliserWebSession().getLocale());
  2019.     kycDiv.add(riskRating.setNullValid(true).setRequired(true).setEnabled(true).add(new ErrorIndicator()));
  2020.    
  2021.     kycDiv.add(new TextArea<String>("customer.kycDetailsBean.textField", new PropertyModel<String>(this, "customer.kycDetailsBean.textField"))
  2022.         .setRequired(false)
  2023.         .add(new PatternValidator(Constants.REGEX_COMMENTS))
  2024.         .add(Constants.mediumStringValidator)
  2025.         .add(Constants.mediumSimpleAttributeModifier)
  2026.         .add(new SimpleAttributeModifier("size",
  2027.             Constants.MAX_LENGTH_SEND_MONEY_TXN_TEXT))
  2028.         .add(new ErrorIndicator()));
  2029.    
  2030.    
  2031.     kycDiv.setVisible(true);
  2032.     form.add(kycDiv);
  2033.    
  2034.     kycDiv.setOutputMarkupPlaceholderTag(true);
  2035.    
  2036.     infoModeSMSEmail.add(new AjaxFormComponentUpdatingBehavior("onchange") {
  2037.         private static final long serialVersionUID = 1L;
  2038.  
  2039.         @Override
  2040.         protected void onUpdate(AjaxRequestTarget target) {
  2041.             emailDiv.setVisible(false);
  2042.             if(customer.getKvInfoMode() == 2 || customer.getKvInfoMode() == 3){
  2043.                 emailDiv.setVisible(true);
  2044.             }
  2045.             target.addComponent(emailDiv);
  2046.         }
  2047.     });
  2048.    
  2049.  
  2050.  
  2051.  
  2052.     customertypes.add(new AjaxFormComponentUpdatingBehavior("onchange") {
  2053.         private static final long serialVersionUID = 1L;
  2054.  
  2055.         @Override
  2056.         protected void onUpdate(AjaxRequestTarget target) {
  2057.            
  2058.         if (customer.getCustomerTypeId() != null){
  2059.             kycDiv.setVisible(true);
  2060.             if(attachmentsPanel != null){
  2061.                 attachmentsPanel.setVisible(true); 
  2062.             }
  2063.            
  2064.             permanentAddressDiv.setVisible(true);
  2065.             businessAddressDiv.setVisible(false);
  2066.            
  2067.             switch(customer.getCustomerTypeId().intValue()){
  2068.             case (Constants.MBANKING_CUSTOMER_TYPE):
  2069.                         kycDiv.setVisible(false);
  2070.             break;
  2071.            
  2072.             case (Constants.STANDARD_CONSUMER):
  2073.                         kycDiv.setVisible(false);
  2074.             break;
  2075.            
  2076.             case (Constants.MERCHANT):
  2077.             break;
  2078.            
  2079.             case (Constants.MERCHANT_AGENT):
  2080.                         kycDiv.setVisible(false);
  2081.             break;
  2082.            
  2083.             case (Constants.BENEFICIARY):
  2084.                         kycDiv.setVisible(false);
  2085.             break;
  2086.            
  2087.             case (Constants.MERCHANT_HEADQUARTER):
  2088.                         accountProfileDiv.setVisible(false);
  2089.                         accountProfileMerchantDiv.setVisible(true);
  2090.             break;
  2091.            
  2092.             case (Constants.MERCHANT_DEALER):
  2093.                         kycDiv.setVisible(false);
  2094.             break;
  2095.            
  2096.             case (Constants.CONSUMER_WITH_FEE):
  2097.                         kycDiv.setVisible(false);
  2098.             break;
  2099.            
  2100.             case (Constants.CUSTOMER_TYPE_L1):
  2101.             case (Constants.CUSTOMER_TYPE_L0):
  2102.                         kycDiv.setVisible(false);
  2103.                         accountProfileDiv.setVisible(false);
  2104.                         accountProfileMerchantDiv.setVisible(false);
  2105.                         businessDetailDiv.setVisible(false);
  2106.  
  2107.                         motherNameDiv.setVisible(true);
  2108.                         fatherHusbandNameDiv.setVisible(true);
  2109.                         placeOfBirthDiv.setVisible(true);
  2110.                         mailingAddressDiv.setVisible(true);
  2111.                         msisdnDiv.setVisible(true);
  2112.                         kvInfoModeDiv.setVisible(true);
  2113.                         landLineDiv.setVisible(true);
  2114.                         kvIdentityTypeDiv.setVisible(true);
  2115.                         cnicExpiryDateDiv.setVisible(true);
  2116.                         kvIdentityValueDiv.setVisible(true);
  2117.                         birthDateDiv.setVisible(true);
  2118.                         identityInfoTitleDiv.setVisible(true);
  2119.                         rolesAndPrivilegesDiv.setVisible(false);
  2120.                
  2121.             break;
  2122.            
  2123.             case (Constants.CUSTOMER_TYPE_L2_INDIVIDUAL_NEW):
  2124.             case (Constants.CUSTOMER_TYPE_L2_INDIVIDUAL_10000):
  2125.             case (Constants.CUSTOMER_TYPE_L2_INDIVIDUAL_50000):
  2126.             case (Constants.CUSTOMER_TYPE_L2_INDIVIDUAL_99999):
  2127.             case (Constants.CUSTOMER_TYPE_L2_INDIVIDUAL_500000):
  2128.                
  2129.                         kycDiv.setVisible(true);
  2130.                         accountsDiv.setVisible(false);
  2131.                         businessDetailDiv.setVisible(false);
  2132.                         accountProfileDiv.setVisible(true);
  2133.                         accountProfileMerchantDiv.setVisible(false);
  2134.                         salaryDiv.setVisible(false);
  2135.                         otherIncomeDiv.setVisible(false);
  2136.                         typeOfTransactionDiv.setVisible(false);
  2137.                         currentBusinessSinceDiv.setVisible(false);
  2138.                         premisesDiv.setVisible(false);
  2139.  
  2140.                         motherNameDiv.setVisible(true);
  2141.                         fatherHusbandNameDiv.setVisible(true);
  2142.                         placeOfBirthDiv.setVisible(true);
  2143.                         mailingAddressDiv.setVisible(true);
  2144.                         msisdnDiv.setVisible(true);
  2145.                         kvInfoModeDiv.setVisible(true);
  2146.                         landLineDiv.setVisible(true);
  2147.                         kvIdentityTypeDiv.setVisible(true);
  2148.                         cnicExpiryDateDiv.setVisible(true);
  2149.                         kvIdentityValueDiv.setVisible(true);
  2150.                         birthDateDiv.setVisible(true);
  2151.                         identityInfoTitleDiv.setVisible(true);
  2152.                         rolesAndPrivilegesDiv.setVisible(false);
  2153.                
  2154.             break;
  2155.             case (Constants.CUSTOMER_TYPE_AGENT_FINJA):
  2156.             case (Constants.CUSTOMER_TYPE_L2_MERCHANT):
  2157.                         kycDiv.setVisible(true);
  2158.                         businessDetailDiv.setVisible(true);
  2159.                         permanentAddressDiv.setVisible(false);
  2160.                         accountProfileDiv.setVisible(false);
  2161.                         accountProfileMerchantDiv.setVisible(true);
  2162.                         salaryDiv.setVisible(true);
  2163.                         otherIncomeDiv.setVisible(true);
  2164.                         typeOfTransactionDiv.setVisible(true);
  2165.                         currentBusinessSinceDiv.setVisible(true);
  2166.                         premisesDiv.setVisible(true);
  2167.                         accountsDiv.setVisible(true);
  2168.                         typeOfCustomer_NotCustomerTypeDiv.setVisible(false);
  2169.                         purposeOfAccountDiv.setVisible(false);
  2170.                         bankRecognitionMediumDiv.setVisible(false);
  2171.                         modeOfTransactionDiv.setVisible(false);
  2172.  
  2173.                         motherNameDiv.setVisible(true);
  2174.                         fatherHusbandNameDiv.setVisible(true);
  2175.                         placeOfBirthDiv.setVisible(true);
  2176.                         mailingAddressDiv.setVisible(true);
  2177.                         msisdnDiv.setVisible(true);
  2178.                         kvInfoModeDiv.setVisible(true);
  2179.                         landLineDiv.setVisible(true);
  2180.                         kvIdentityTypeDiv.setVisible(true);
  2181.                         cnicExpiryDateDiv.setVisible(true);
  2182.                         kvIdentityValueDiv.setVisible(true);
  2183.                         birthDateDiv.setVisible(true);
  2184.                         identityInfoTitleDiv.setVisible(true);
  2185.                         rolesAndPrivilegesDiv.setVisible(false);
  2186.             break;
  2187.            
  2188.             case (Constants.CUSTOMER_TYPE_CST_SUB_AGENT):
  2189.                         kycDiv.setVisible(false);
  2190.                         businessDetailDiv.setVisible(false);
  2191.                         businessAddressDiv.setVisible(false);
  2192.                         permanentAddressDiv.setVisible(false);
  2193.                         accountProfileDiv.setVisible(false);
  2194.                         accountProfileMerchantDiv.setVisible(false);
  2195.                         salaryDiv.setVisible(false);
  2196.                         otherIncomeDiv.setVisible(false);
  2197.                         typeOfTransactionDiv.setVisible(false);
  2198.                         currentBusinessSinceDiv.setVisible(false);
  2199.                         premisesDiv.setVisible(false);
  2200.                         accountsDiv.setVisible(false);
  2201.                         typeOfCustomer_NotCustomerTypeDiv.setVisible(false);
  2202.                         purposeOfAccountDiv.setVisible(false);
  2203.                         bankRecognitionMediumDiv.setVisible(false);
  2204.                         modeOfTransactionDiv.setVisible(false);
  2205.  
  2206.                         motherNameDiv.setVisible(false);
  2207.                         fatherHusbandNameDiv.setVisible(false);
  2208.                         placeOfBirthDiv.setVisible(false);
  2209.                         mailingAddressDiv.setVisible(false);
  2210.                         msisdnDiv.setVisible(false);
  2211.                         kvInfoModeDiv.setVisible(false);
  2212.                         landLineDiv.setVisible(false);
  2213.                         kvIdentityTypeDiv.setVisible(false);
  2214.                         cnicExpiryDateDiv.setVisible(false);
  2215.                         kvIdentityValueDiv.setVisible(false);
  2216.                         birthDateDiv.setVisible(false);
  2217.                         identityInfoTitleDiv.setVisible(false);
  2218.                         rolesAndPrivilegesDiv.setVisible(true);
  2219.             break;      
  2220.            
  2221.             case (Constants.CUSTOMER_TYPE_GUEST):
  2222.                         kycDiv.setVisible(false);
  2223.                         attachmentsPanel.setVisible(false);
  2224.             break;
  2225.            
  2226.             default :
  2227.             break;
  2228.             }
  2229.            
  2230.         }else{
  2231.         }
  2232.        
  2233.         target.addComponent(kycDiv);
  2234.         target.addComponent(accountProfileDiv);
  2235.         target.addComponent(accountProfileMerchantDiv);
  2236.        
  2237.         target.addComponent(businessDetailDiv);
  2238.         target.addComponent(permanentAddressDiv);
  2239.        
  2240.         target.addComponent(businessNameDiv);
  2241.         target.addComponent(ntnNumberDiv);
  2242.         target.addComponent(businessAddressDiv);
  2243.        
  2244.         target.addComponent(salaryDiv);
  2245.         target.addComponent(otherIncomeDiv);
  2246.         target.addComponent(typeOfTransactionDiv);
  2247.         target.addComponent(currentBusinessSinceDiv);
  2248.         target.addComponent(premisesDiv);
  2249.        
  2250.         target.addComponent(monthlyExpectedDepositDiv);
  2251.         target.addComponent(monthlyExpectedWithdrawalDiv);
  2252.         target.addComponent(expectedAvgBalanceDiv);
  2253.         target.addComponent(annualTurnoverDiv);
  2254.         target.addComponent(expectedMonthlyCreditSalesDiv);
  2255.        
  2256.         target.addComponent(averageMonthlyInflowDiv);
  2257.         target.addComponent(averageMonthlyOutflowDiv);
  2258.         target.addComponent(averageYearlySalesDiv);
  2259.         target.addComponent(avergaeYearlyIncomeDiv);
  2260.        
  2261.         target.addComponent(typeOfCustomer_NotCustomerTypeDiv);
  2262.         target.addComponent(purposeOfAccountDiv);
  2263.         target.addComponent(bankRecognitionMediumDiv);
  2264.         target.addComponent(modeOfTransactionDiv);
  2265.        
  2266.         target.addComponent(infoModeSMSEmail);
  2267.         target.addComponent(motherNameDiv);
  2268.         target.addComponent(fatherHusbandNameDiv);
  2269.         target.addComponent(placeOfBirthDiv);
  2270.        
  2271.         target.addComponent(msisdnDiv);
  2272.         target.addComponent(kvInfoModeDiv);
  2273.         target.addComponent(landLineDiv);
  2274.         target.addComponent(kvIdentityTypeDiv);
  2275.         target.addComponent(cnicExpiryDateDiv);
  2276.         target.addComponent(kvIdentityValueDiv);
  2277.         target.addComponent(birthDateDiv);
  2278.         target.addComponent(mailingAddressDiv);
  2279.         target.addComponent(identityInfoTitleDiv);
  2280.        
  2281.        
  2282.         if(attachmentsPanel != null){
  2283.             target.addComponent(attachmentsPanel); 
  2284.         }
  2285.        
  2286.         }
  2287.     });
  2288.  
  2289.    
  2290.     // adding captcha and terms and conditions
  2291.     WebMarkupContainer signUpDiv = new WebMarkupContainer("signUpDiv");
  2292.     final CaptchaImage captchaImage = new CaptchaImage("captchaImage");
  2293.     captchaImage.setOutputMarkupId(true);
  2294.  
  2295.     captchTextField = new RequiredTextField<Object>("captcha") {
  2296.  
  2297.         private static final long serialVersionUID = 1L;
  2298.  
  2299.         @Override
  2300.         protected void onComponentTag(final ComponentTag tag) {
  2301.         super.onComponentTag(tag);
  2302.         if (form.hasError() && !this.hasErrorMessage())
  2303.             tag.put("value", "");
  2304.  
  2305.         }
  2306.     };
  2307.     captchTextField.add(new CaptchaValidator());
  2308.     captchTextField.add(new ErrorIndicator());
  2309.     signUpDiv.add(captchTextField);
  2310.  
  2311.     signUpDiv.add(new AjaxFallbackLink<Object>("captchLink") {
  2312.         /**
  2313.          *
  2314.          */
  2315.         private static final long serialVersionUID = 1L;
  2316.  
  2317.         @Override
  2318.         public void onClick(AjaxRequestTarget target) {
  2319.         captchaImage.detach();
  2320.  
  2321.         if (target != null) {
  2322.             target.addComponent(captchaImage);
  2323.         } else {
  2324.             // javascript is disabled
  2325.         }
  2326.         }
  2327.  
  2328.     }.add(captchaImage));
  2329.  
  2330.     try {
  2331.         if (!PortalUtils.exists(basePage.getMobiliserWebSession()
  2332.             .getLoggedInCustomer())) {
  2333.         listTermAndCondition = servicePackagesClientLogic
  2334.             .getDefaultTermAndConditions(
  2335.                 customer.getCustomerTypeId(),
  2336.                 customer.getOrgUnitId());
  2337.         }
  2338.     } catch (Exception e) {
  2339.         LOG.error(
  2340.             "# An error has occurred while loading TermAndConditions",
  2341.             e);
  2342.         error(getLocalizer().getString(
  2343.             "customerRegistration.TermAndCondition.error", this));
  2344.     }
  2345.  
  2346.     WebMarkupContainer tncsDiv = new WebMarkupContainer("tncsDiv");
  2347.     tncsDiv.setOutputMarkupId(true);
  2348.     tncsDiv.setOutputMarkupPlaceholderTag(true);
  2349.     ListView<TermAndCondition> listView = new ListView<TermAndCondition>(
  2350.         "tncs", listTermAndCondition) {
  2351.         private static final long serialVersionUID = 1L;
  2352.  
  2353.         @Override
  2354.         protected void populateItem(ListItem<TermAndCondition> item) {
  2355.  
  2356.         TermAndCondition entry = item.getModelObject();
  2357.  
  2358.         // Select box
  2359.         AjaxCheckBox selectedCheckBox = new AjaxCheckBoxImpl(
  2360.             "selected", new Model<Boolean>(new Boolean(
  2361.                 isSelected(entry))), entry);
  2362.         Label asterik = null;
  2363.         Label label = new Label("conditions", entry.getTncText());
  2364.  
  2365.         item.add(label);
  2366.         item.add(selectedCheckBox);
  2367.         if (entry.isMandatory()) {
  2368.             asterik = new Label("asterik", "*");
  2369.             requiredTermAndConditions.add(entry);
  2370.             asterik.add(new SimpleAttributeModifier("class", "required"));
  2371.         }
  2372.         if (!PortalUtils.exists(asterik)) {
  2373.             asterik = new Label("asterik", "");
  2374.             asterik.add(new SimpleAttributeModifier("class",
  2375.                 "paddingLeft"));
  2376.         }
  2377.         item.add(asterik);
  2378.         }
  2379.  
  2380.         private boolean isSelected(TermAndCondition entry) {
  2381.  
  2382.         return selectedTermAndConditions.contains(entry);
  2383.         }
  2384.  
  2385.         class AjaxCheckBoxImpl extends AjaxCheckBox {
  2386.  
  2387.         private static final long serialVersionUID = 1L;
  2388.         private final TermAndCondition entry;
  2389.  
  2390.         public AjaxCheckBoxImpl(String id, IModel<Boolean> model,
  2391.             TermAndCondition entry) {
  2392.             super(id, model);
  2393.             this.entry = entry;
  2394.         }
  2395.  
  2396.         @Override
  2397.         public boolean isEnabled() {
  2398.             return true;
  2399.         }
  2400.  
  2401.         @Override
  2402.         protected void onComponentTag(final ComponentTag tag) {
  2403.             super.onComponentTag(tag);
  2404.             if (getModelObject().booleanValue()) {
  2405.             tag.put("checked", "checked");
  2406.             }
  2407.         }
  2408.  
  2409.         @Override
  2410.         protected void onUpdate(AjaxRequestTarget target) {
  2411.             boolean checkBoxSelected = getModelObject().booleanValue();
  2412.             if (checkBoxSelected) {
  2413.             LOG.info("Added {} to deletion list",
  2414.                 entry.getTncVersionId());
  2415.             selectedTermAndConditions.add(entry);
  2416.             } else {
  2417.             LOG.info("Removed {} from deletion list",
  2418.                 entry.getTncVersionId());
  2419.             selectedTermAndConditions.remove(entry);
  2420.             }
  2421.         }
  2422.         }
  2423.  
  2424.     };
  2425.     if (!PortalUtils.exists(listTermAndCondition)) {
  2426.         tncsDiv.setVisible(false);
  2427.     }
  2428.     tncsDiv.add(listView);
  2429.     signUpDiv.add(tncsDiv);
  2430.     form.add(signUpDiv);
  2431.  
  2432.  
  2433.     WebMarkupContainer signupButtons = new WebMarkupContainer(
  2434.         "signupButtons");
  2435.     signupButtons.setVisible(true);
  2436.     signupButtons.add(new Button("continue") {
  2437.         private static final long serialVersionUID = 1L;
  2438.  
  2439.         @Override
  2440.         public void onSubmit() {
  2441.         if (isEligible()) {
  2442.             continueSignUp();
  2443.         } else {
  2444.             return;
  2445.         }
  2446.  
  2447.         };
  2448.     });
  2449.  
  2450.     signupButtons.add(new Button("back") {
  2451.         private static final long serialVersionUID = 1L;
  2452.  
  2453.         @Override
  2454.         public void onSubmit() {
  2455.         handleBack();
  2456.         };
  2457.     }.setDefaultFormProcessing(false));
  2458.  
  2459.     signupButtons.add(new Button("cancelSignup") {
  2460.         private static final long serialVersionUID = 1L;
  2461.  
  2462.         @Override
  2463.         public void onSubmit() {
  2464.         handleCancel();
  2465.         };
  2466.     }.setDefaultFormProcessing(false));
  2467.  
  2468.     form.add(signupButtons);
  2469.  
  2470.     WebMarkupContainer cstButtons = new WebMarkupContainer("cstButtons");
  2471.     cstButtons.setVisible(true);
  2472.     cstButtons.add(new Button("register") {
  2473.         private static final long serialVersionUID = 1L;
  2474.  
  2475.         @Override
  2476.         public void onSubmit() {
  2477.         if (isEligible()||customer.getCustomerTypeId()==Constants.CUSTOMER_TYPE_CST_SUB_AGENT) {
  2478.             continueRegistration();
  2479.         } else {
  2480.             return;
  2481.         }
  2482.         };
  2483.     });
  2484.     form.add(cstButtons);
  2485.  
  2486.     WebMarkupContainer dppButtons = new WebMarkupContainer("dppButtons");
  2487.     dppButtons.setVisible(true);
  2488.     dppButtons.add(new Button("cancel") {
  2489.         private static final long serialVersionUID = 1L;
  2490.  
  2491.         @Override
  2492.         public void onSubmit() {
  2493.         setResponsePage(systemCustomerClient.getMobiliserApplication()
  2494.             .getPage(SelfCareHomePage.class));
  2495.         };
  2496.     }.setDefaultFormProcessing(false));
  2497.  
  2498.     dppButtons.add(new Button("save") {
  2499.         private static final long serialVersionUID = 1L;
  2500.  
  2501.         @Override
  2502.         public void onSubmit() {
  2503.         try {
  2504.             if (!isEligible()) {
  2505.             return;
  2506.             }
  2507.             if(customer.getCustomerTypeId() == Constants.CUSTOMER_TYPE_GUEST){
  2508.                 LOG.info("In case for guest, we will skip the attachments");
  2509.             }else{
  2510.             }
  2511.            
  2512.             customer.setUserName(customer.getAddress().getEmail());
  2513.             LOG.info("Setting the username {} and email id {} ", new Object[]{customer.getUserName(), customer.getAddress().getEmail()});
  2514.            
  2515.             if(!isEligibleCNICExpiry()){
  2516.                 return;
  2517.             }
  2518.            
  2519.             if (!systemCustomerClient.uniqueIdentificationCheck(
  2520.                 getCustomer().getMsisdn(),
  2521.                 Constants.IDENT_TYPE_MSISDN, getCustomer().getId(),
  2522.                 configuration.getCountryCode()))
  2523.             return;
  2524.             if(getCustomer().getUserName() != null){
  2525.                 if (!systemCustomerClient.uniqueIdentificationCheck(
  2526.                         getCustomer().getUserName(),
  2527.                         Constants.IDENT_TYPE_USERNAME, getCustomer()
  2528.                             .getId(), configuration.getCountryCode()))
  2529.                     return;
  2530.             }
  2531.            
  2532.             saveCustomer();
  2533.         } catch (Exception e) {
  2534.             LOG.error(
  2535.                 "#An error occurred while registering a customer",
  2536.                 e);
  2537.             error(getLocalizer().getString("register.customer.error",
  2538.                 this));
  2539.         }
  2540.         }
  2541.  
  2542.         @SuppressWarnings("unused")
  2543.         private boolean checkAttachments() {
  2544.         if (attachmentsPanel.getAttachments().isEmpty())
  2545.             return false;
  2546.         else
  2547.             return true;
  2548.         };
  2549.  
  2550.     });
  2551.  
  2552.     form.add(dppButtons);
  2553.  
  2554.     // field toggling for CST
  2555.     if (getBasePage().getMobiliserWebSession().getRoles().hasRole(Constants.PRIV_CST_LOGIN)) {
  2556.         titleDiv.setVisible(false);
  2557.         dppButtons.setVisible(false);
  2558.         signupButtons.setVisible(false);
  2559.         signUpDiv.setVisible(false);
  2560.         identityTypeDropDown.setRequired(true);
  2561.         kvIdentityTypeDiv.addOrReplace(new Label("requiredIdentityType", "*"));
  2562.         identityValueField.setRequired(false);
  2563.         identityValueField.setRequired(true);
  2564.         kycDiv.setVisible(true);
  2565.         businessDetailDiv.setVisible(false);
  2566.         accountProfileDiv.setVisible(false);
  2567.         accountProfileMerchantDiv.setVisible(false);
  2568.        
  2569.        
  2570.         motherNameDiv.setVisible(true);
  2571.         fatherHusbandNameDiv.setVisible(true);
  2572.         placeOfBirthDiv.setVisible(true);
  2573.         mailingAddressDiv.setVisible(true);
  2574.         msisdnDiv.setVisible(true);
  2575.         kvInfoModeDiv.setVisible(true);
  2576.         landLineDiv.setVisible(true);
  2577.         kvIdentityTypeDiv.setVisible(true);
  2578.         cnicExpiryDateDiv.setVisible(true);
  2579.         kvIdentityValueDiv.setVisible(true);
  2580.         birthDateDiv.setVisible(true);
  2581.         identityInfoTitleDiv.setVisible(true);
  2582.         rolesAndPrivilegesDiv.setVisible(true);
  2583.        
  2584.        
  2585.        
  2586.         // Here we make the KYC fields mandatory
  2587.         kycDiv.addOrReplace(new Label("requiredIsBeneficialAccountOwner", "*"));
  2588.        
  2589.         typeOfCustomer_NotCustomerTypeDiv.addOrReplace(new Label("requiredTypeOfCustomer_NotCustomerType", "*"));
  2590.         bankRecognitionMediumDiv.addOrReplace(new Label("requiredBankRecognitionMedium", "*"));
  2591.         purposeOfAccountDiv.addOrReplace(new Label("requiredPurposeOfAccount", "*"));
  2592.         modeOfTransactionDiv.addOrReplace(new Label("requiredModeOfTransaction", "*"));
  2593.        
  2594.        
  2595.         actualBeneficialOwnerDiv.addOrReplace(new Label("requiredActualBeneficialOwner", "*"));
  2596.         averageMonthlyInflowDiv.addOrReplace(new Label("requiredAverageMonthlyInflow", "*"));
  2597.         avergaeYearlyIncomeDiv.addOrReplace(new Label("requiredAvergaeYearlyIncome", "*"));
  2598.         cnicBeneficialDiv.addOrReplace(new Label("requiredCnicBeneficial", "*"));
  2599.         relationWithApplicantDiv.addOrReplace(new Label("requiredRelationWithApplicant", "*"));
  2600.         averageMonthlyOutflowDiv.addOrReplace(new Label("requiredAverageMonthlyOutflow", "*"));
  2601.         averageYearlySalesDiv.addOrReplace(new Label("requiredAverageYearlySales", "*"));
  2602.        
  2603.         sourceOfIncomeDiv.addOrReplace(new Label("requiredSourceOfIncome", "*"));
  2604.         typeOfTransactionDiv.addOrReplace(new Label("requiredTypeOfTransaction", "*"));
  2605.         currentBusinessSinceDiv.addOrReplace(new Label("requiredCurrentBusinessSince", "*"));
  2606.         premisesDiv.addOrReplace(new Label("requiredPremises", "*"));
  2607.        
  2608.        
  2609.        
  2610.         kycDiv.add(actualBeneficialOwnerDiv);
  2611.         kycDiv.add(cnicBeneficialDiv);
  2612.         kycDiv.add(relationWithApplicantDiv);
  2613.        
  2614.         accountProfileDiv.add(averageMonthlyOutflowDiv);
  2615.         accountProfileDiv.add(averageYearlySalesDiv);
  2616.         accountProfileDiv.add(averageMonthlyInflowDiv);
  2617.         accountProfileDiv.add(avergaeYearlyIncomeDiv);
  2618.        
  2619.         kycDiv.add(sourceOfIncomeDiv);
  2620.         kycDiv.add(typeOfTransactionDiv);
  2621.         kycDiv.add(currentBusinessSinceDiv);
  2622.         kycDiv.add(premisesDiv);
  2623.        
  2624.        
  2625.         kycDiv.addOrReplace(new Label("requiredAccRelegiousOrgOrMadrassa", "*"));
  2626.         kycDiv.addOrReplace(new Label("requiredPoliticalyExposed", "*"));
  2627.         kycDiv.addOrReplace(new Label("requiredLandLord", "*"));
  2628.         kycDiv.addOrReplace(new Label("requiredRefusedByOtherBank", "*"));
  2629.         kycDiv.addOrReplace(new Label("requiredDealingWithHighLowRiskCountry", "*"));
  2630.         kycDiv.addOrReplace(new Label("requiredCustomerResident", "*"));
  2631.         kycDiv.addOrReplace(new Label("requiredCustomerActualOwnerOfAcc", "*"));
  2632.         kycDiv.addOrReplace(new Label("requiredRiskRating", "*"));
  2633.         kycDiv.addOrReplace(new Label("requiredCustomerAsDirectorOrGovBody", "*"));
  2634.        
  2635.         kycDiv.addOrReplace(new Label("requiredHouseWife", "*"));
  2636.         kycDiv.addOrReplace(new Label("requiredCustomerMinorAccount", "*"));
  2637.         kycDiv.addOrReplace(new Label("requiredCustomerProfesion", "*"));
  2638.         kycDiv.addOrReplace(new Label("requiredProductAndServiceMappingMatch", "*"));
  2639.         kycDiv.addOrReplace(new Label("requiredCustomerbusinessStructure", "*"));
  2640.         kycDiv.addOrReplace(new Label("requiredCustomerHoldMall", "*"));
  2641.         kycDiv.addOrReplace(new Label("requiredTextField", "*"));
  2642.        
  2643.        
  2644.     } else if (getBasePage().getMobiliserWebSession().getRoles().hasRole(Constants.PRIV_MERCHANT_LOGIN)) {
  2645.         titleDiv.setVisible(false);
  2646.         identityInfoDiv.setVisible(true);
  2647.         infoModeDiv.setVisible(true);
  2648.         cstButtons.setVisible(false);
  2649.         accountProfileDiv.setVisible(false);
  2650.         accountProfileMerchantDiv.setVisible(true);
  2651.        
  2652.         customerTypeDiv.setVisible(true);
  2653.         signupButtons.setVisible(false);
  2654.         signUpDiv.setVisible(false);
  2655.         identityTypeDropDown.setRequired(true);
  2656.         kycDiv.setVisible(false);
  2657.         kvIdentityTypeDiv.addOrReplace(new Label("requiredIdentityType", "*"));
  2658.         identityValueField.setRequired(true);
  2659.         businessAddressDiv.setVisible(false);
  2660.         accountProfileDiv.setVisible(false);
  2661.         accountProfileMerchantDiv.setVisible(false);
  2662.         businessDetailDiv.setVisible(false);
  2663.        
  2664.         motherNameDiv.setVisible(true);
  2665.         fatherHusbandNameDiv.setVisible(true);
  2666.         placeOfBirthDiv.setVisible(true);
  2667.         mailingAddressDiv.setVisible(true);
  2668.         msisdnDiv.setVisible(true);
  2669.         kvInfoModeDiv.setVisible(true);
  2670.         landLineDiv.setVisible(true);
  2671.         kvIdentityTypeDiv.setVisible(true);
  2672.         cnicExpiryDateDiv.setVisible(true);
  2673.         kvIdentityValueDiv.setVisible(true);
  2674.         birthDateDiv.setVisible(true);
  2675.         identityInfoTitleDiv.setVisible(true);
  2676.         rolesAndPrivilegesDiv.setVisible(true);
  2677.        
  2678.        
  2679.        
  2680.        
  2681.         if(getBasePage().getMobiliserWebSession().getRoles().hasRole(Constants.PRIV_HEAD_QUARTER_AGENT)){
  2682.             kycDiv.setVisible(true);   
  2683.             // Here we make the KYC fields mandatory
  2684.             kycDiv.addOrReplace(new Label("requiredIsBeneficialAccountOwner", "*"));
  2685.  
  2686.            
  2687.             typeOfCustomer_NotCustomerTypeDiv.addOrReplace(new Label("requiredTypeOfCustomer_NotCustomerType", "*"));
  2688.             bankRecognitionMediumDiv.addOrReplace(new Label("requiredBankRecognitionMedium", "*"));
  2689.             purposeOfAccountDiv.addOrReplace(new Label("requiredPurposeOfAccount", "*"));
  2690.             modeOfTransactionDiv.addOrReplace(new Label("requiredModeOfTransaction", "*"));
  2691.            
  2692.             actualBeneficialOwnerDiv.addOrReplace(new Label("requiredActualBeneficialOwner", "*"));
  2693.             averageMonthlyInflowDiv.addOrReplace(new Label("requiredAverageMonthlyInflow", "*"));
  2694.             avergaeYearlyIncomeDiv.addOrReplace(new Label("requiredAvergaeYearlyIncome", "*"));
  2695.             cnicBeneficialDiv.addOrReplace(new Label("requiredCnicBeneficial", "*"));
  2696.             relationWithApplicantDiv.addOrReplace(new Label("requiredRelationWithApplicant", "*"));
  2697.             averageMonthlyOutflowDiv.addOrReplace(new Label("requiredAverageMonthlyOutflow", "*"));
  2698.             averageYearlySalesDiv.addOrReplace(new Label("requiredAverageYearlySales", "*"));
  2699.            
  2700.             sourceOfIncomeDiv.addOrReplace(new Label("requiredSourceOfIncome", "*"));
  2701.             typeOfTransactionDiv.addOrReplace(new Label("requiredTypeOfTransaction", "*"));
  2702.             currentBusinessSinceDiv.addOrReplace(new Label("requiredCurrentBusinessSince", "*"));
  2703.             premisesDiv.addOrReplace(new Label("requiredPremises", "*"));
  2704.            
  2705.            
  2706.             kycDiv.add(actualBeneficialOwnerDiv);
  2707.             kycDiv.add(cnicBeneficialDiv);
  2708.             kycDiv.add(relationWithApplicantDiv);
  2709.            
  2710.             kycDiv.addOrReplace(new Label("requiredAccRelegiousOrgOrMadrassa", "*"));
  2711.             kycDiv.addOrReplace(new Label("requiredPoliticalyExposed", "*"));
  2712.             kycDiv.addOrReplace(new Label("requiredLandLord", "*"));
  2713.             kycDiv.addOrReplace(new Label("requiredRefusedByOtherBank", "*"));
  2714.             kycDiv.addOrReplace(new Label("requiredDealingWithHighLowRiskCountry", "*"));
  2715.             kycDiv.addOrReplace(new Label("requiredCustomerResident", "*"));
  2716.             kycDiv.addOrReplace(new Label("requiredCustomerActualOwnerOfAcc", "*"));
  2717.             kycDiv.addOrReplace(new Label("requiredRiskRating", "*"));
  2718.             kycDiv.addOrReplace(new Label("requiredCustomerAsDirectorOrGovBody", "*"));
  2719.            
  2720.             kycDiv.addOrReplace(new Label("requiredHouseWife", "*"));
  2721.             kycDiv.addOrReplace(new Label("requiredCustomerMinorAccount", "*"));
  2722.             kycDiv.addOrReplace(new Label("requiredCustomerProfesion", "*"));
  2723.             kycDiv.addOrReplace(new Label("requiredProductAndServiceMappingMatch", "*"));
  2724.             kycDiv.addOrReplace(new Label("requiredCustomerbusinessStructure", "*"));
  2725.             kycDiv.addOrReplace(new Label("requiredCustomerHoldMall", "*"));
  2726.             kycDiv.addOrReplace(new Label("requiredTextField", "*"));
  2727.            
  2728.         }
  2729.     } else {
  2730.         cstButtons.setVisible(false);
  2731.         dppButtons.setVisible(false);
  2732.         kvIdentityTypeDiv.addOrReplace(new Label("requiredIdentityType", "*"));
  2733.         identityValueField.setRequired(true);
  2734. //      identityInfoDiv.addOrReplace(new Label("requiredIdentityValue", "*"));
  2735.         customerTypeDiv.setVisible(false);
  2736.         kycDiv.setVisible(false);
  2737.     }
  2738.     form.add(new TooltipBehavior());
  2739.     add(form);
  2740.     }
  2741.  
  2742.     protected void saveCustomer() {
  2743.     LOG.debug("#RegisterCustomerPanel.next()");
  2744.  
  2745.     CustomerBean merchantCustomer = new CustomerBean();
  2746.     Customer merchantCust = new Customer();
  2747.    
  2748.     try {
  2749.         if (!systemCustomerClient.uniqueIdentificationCheck(
  2750.             (getCustomer().getMsisdn()), Constants.IDENT_TYPE_MSISDN,
  2751.             getCustomer().getId(), configuration.getCountryCode())) {
  2752.         return;
  2753.         }
  2754.         if(!ValidationUtils.isMobileNumberValid(getCustomer().getMsisdn())){
  2755.             error(getLocalizer().getString("invalid.mobileNo.format.error", this));
  2756.                 return;
  2757.         }
  2758.        
  2759.         if(!systemCustomClient.uniqueCNICCheck(getCustomer().getIdentityValue())){
  2760.             LOG.info("duplicate CNIC found in database, returning");
  2761.             error(getLocalizer().getString("customer.duplicate.cnic.error", this));
  2762.             return;
  2763.         }
  2764.        
  2765.         if(customer.getKvInfoMode() == 0 || customer.getKvInfoMode() == 1){
  2766.             if(customer.getAddress() != null){
  2767.                 LOG.info("Setting email to null since the user selected the other option");
  2768.                 customer.getAddress().setEmail("");
  2769.             }
  2770.         }
  2771.        
  2772.        
  2773.         customer.setRiskCategoryId(null);
  2774.         customer.getAddress().setKvCountry(customer.getKvCountry());
  2775.         List<String> privList = systemCustomerSecurityClient
  2776.             .getDefaultPrivileges(customer.getCustomerTypeId(),
  2777.                 customer.getRiskCategoryId());
  2778.  
  2779.         if(basePage.getMobiliserWebSession().hasPrivilege(Constants.PRIV_HEAD_QUARTER_AGENT)
  2780.                 || basePage.getMobiliserWebSession().hasPrivilege(Constants.PRIV_MERCHANT_LOGIN)){
  2781.            
  2782.             LOG.info("Logged in Customer : "+basePage.getMobiliserWebSession().getLoggedInCustomer().getCustomerId());
  2783.            
  2784.             if (basePage.getMobiliserWebSession().getLoggedInCustomer() != null) { 
  2785.                 LOG.info("Logger in Customer : "+basePage.getMobiliserWebSession().getLoggedInCustomer().getCustomerId());
  2786.                
  2787.                 merchantCust = systemCustomerClient.getCustomerDetails(basePage.getMobiliserWebSession().getLoggedInCustomer().getCustomerId());
  2788.                 merchantCustomer = Converter.getInstance(configuration).getCustomerBeanFromCustomer(merchantCust);
  2789.                 LOG.info("Successfully got the Merchant Bean with customer ID : "+merchantCustomer.getId());
  2790.                
  2791.                 if(customer.getCustomerTypeId() == Constants.CUSTOMER_TYPE_GUEST || customer.getCustomerTypeId() == Constants.CUSTOMER_TYPE_L0
  2792.                         || customer.getCustomerTypeId() == Constants.CUSTOMER_TYPE_L1){
  2793.                     LOG.info("Skipping the setting parent and hirarchy part.");
  2794.                 }
  2795.                 else{
  2796.                     customer.setParentId(basePage.getMobiliserWebSession().getLoggedInCustomer().getCustomerId());
  2797.                     customer.setHierarchyLevel(merchantCustomer.getHierarchyLevel() + 1);  
  2798.                 }
  2799.                
  2800.             }
  2801.  
  2802.             if (!basePage.getMobiliserWebSession().hasPrivilege(Constants.PRIV_ACTIVATE_DESCENDANTS)) {
  2803.                 if (!basePage.getMobiliserWebSession().hasPrivilege(Constants.PRIV_CREATE_ACTIVE_DESCENDANTS)) {
  2804.                     customer.setBlackListReason(Constants.PENDING_REG_MERCHANT_BLACKLSTREASON);
  2805.                 } else {
  2806.                     customer.setBlackListReason(Constants.DEFAULT_MERCHANT_BLACKLSTREASON);
  2807.                 }
  2808.             } else {
  2809.                 customer.setBlackListReason(Constants.DEFAULT_MERCHANT_BLACKLSTREASON);
  2810.             }
  2811.            
  2812.             LOG.info("setting the Customer type : "+customer.getCustomerTypeId());
  2813.             //customer.setCustomerTypeId(Constants.CUSTOMER_TYPE_MERCHANT);
  2814.             LOG.info("getting name as per cnic : "+customer.getAddress().getNameAsPerCNIC());
  2815.            
  2816.             customer.setLoggedInCustomer(String.valueOf(basePage.getMobiliserWebSession().getLoggedInCustomer().getCustomerId()));
  2817.             LOG.info("LoggedInCustomer Before calling CustomerClientLogic.createFullCustomer()"+basePage.getMobiliserWebSession().getLoggedInCustomer().getCustomerId());
  2818.            
  2819.             customer = selfCustomerClient.createFullCustomer(customer,
  2820.                     getAttachments(), privList, null, configuration, null);
  2821.            
  2822.             /// customization by NoumanZaidi for Notifications
  2823.             sendSMSNotification();
  2824.             //
  2825.         }
  2826.         else{
  2827.             if(basePage.getMobiliserWebSession().hasPrivilege(Constants.PRIV_CST_LOGIN)){
  2828.                 LOG.info("setting the Customer type : "+customer.getCustomerTypeId());
  2829.                 LOG.info("getting name as per cnic : "+customer.getAddress().getNameAsPerCNIC());
  2830.                 customer.setLoggedInCustomer(String.valueOf(basePage.getMobiliserWebSession().getLoggedInCustomer().getCustomerId()));
  2831.                 LOG.info("LoggedInCustomer Before calling CustomerClientLogic.createFullCustomer()"+basePage.getMobiliserWebSession().getLoggedInCustomer().getCustomerId());
  2832.                
  2833.                 customer = systemCustomerClient.createFullCustomer(customer,
  2834.                         getAttachments(), privList, null, configuration, null);
  2835.                
  2836.                 /*if(customer.getKvIdentityType()==4){
  2837.                     customer
  2838.                    
  2839.                 }*/
  2840.                
  2841.                 /// customization by NoumanZaidi for Notifications
  2842.                 sendSMSNotification();
  2843.                 //
  2844.             }  
  2845.         }
  2846.        
  2847.  
  2848.         if (PortalUtils.exists(customer)) {
  2849.             if (customer.isPendingApproval()) {
  2850.                 /// customization by NoumanZaidi for Notifications
  2851.                 sendSMSNotification();
  2852.                 //
  2853.                 customer = null;
  2854.                 info(getLocalizer().getString("pendingApproval.msg", this));
  2855.                 setResponsePage(basePage);
  2856.                
  2857.             } else {
  2858.                 info("Customer created successfully");
  2859.                 getBasePage().getMobiliserWebSession()
  2860.                     .setCustomer(customer);
  2861.                 customer.setMsisdn(new PhoneNumber(customer.getMsisdn())
  2862.                     .getInternationalFormat());
  2863.                 customer.setDisplayName(systemCustomerClient
  2864.                     .createDisplayName(customer.getAddress()
  2865.                         .getFirstName(), customer.getAddress().getMiddleName(),
  2866.                         customer.getAddress().getLastName()));
  2867.                 if (getBasePage().getMobiliserWebSession().getRoles()
  2868.                         .hasRole(Constants.PRIV_HEAD_QUARTER_AGENT)){
  2869. //                  setResponsePage(systemCustomerClient.getMobiliserApplication().getPageInstance(AgentUmgrHandlingPage.class));
  2870.                     setResponsePage(systemCustomerClient.getMobiliserApplication().getPageInstance(
  2871.                             com.sybase365.mobiliser.web.distributor.pages.agentcare.CommissionManagementPage.class));
  2872.                    
  2873.                 }else{
  2874.                     if (getBasePage().getMobiliserWebSession().getRoles()
  2875.                         .hasRole(Constants.PRIV_MERCHANT_LOGIN)) {
  2876.                         if(getCustomer().getCustomerTypeId() == Constants.CUSTOMER_TYPE_MERCHANT_AGENT
  2877.                                 || getCustomer().getCustomerTypeId() == Constants.CUSTOMER_TYPE_MERCHANT_DEALER){
  2878.                             LOG.info("This is the request for Agent or a Dealer");
  2879.                             setResponsePage(systemCustomerClient.getMobiliserApplication().getPageInstance(
  2880.                                     com.sybase365.mobiliser.web.distributor.pages.agentcare.CommissionManagementPage.class));
  2881.                         }else{
  2882.                             LOG.info("The created customer is a Customer , Not an agent or dealer");
  2883.                             setResponsePage(systemCustomerClient.getMobiliserApplication().getPageInstance(CustomerDetailsPage.class));
  2884.                             /// customization by NoumanZaidi for Notifications
  2885.                             sendSMSNotification();
  2886.                             //
  2887.                         }
  2888.                     }
  2889.                     else{
  2890.                         if (getBasePage().getMobiliserWebSession().getRoles()
  2891.                                 .hasRole(Constants.PRIV_CST_LOGIN)){
  2892.                             setResponsePage(systemCustomerClient.getMobiliserApplication().getPageInstance(StandingDataPage.class, getCustomer()));
  2893.                         }
  2894.                     }
  2895.                 }
  2896.             }
  2897.         }
  2898.     } catch (Exception e) {
  2899.         LOG.error("# An error has occurred for register customer ", e);
  2900.         error(getLocalizer().getString("customerRegistration.error", this));
  2901.     }
  2902.     }
  2903.    
  2904.    
  2905.    
  2906.    
  2907.    
  2908.    
  2909.    
  2910.    
  2911.  
  2912.     public MobiliserBasePage getBasePage() {
  2913.     return basePage;
  2914.     }
  2915.  
  2916.     public void setBasePage(MobiliserBasePage basePage) {
  2917.     this.basePage = basePage;
  2918.     }
  2919.  
  2920.     public CustomerBean getCustomer() {
  2921.     return customer;
  2922.     }
  2923.  
  2924.     public void setCustomer(CustomerBean customer) {
  2925.     this.customer = customer;
  2926.     }
  2927.  
  2928.     public List<Attachment> getAttachments() {
  2929.     List<Attachment> attachments = attachmentsPanel.getAttachments();
  2930.     LOG.info("in getAttachments() function : "+attachments);
  2931.     if (attachments == null) {
  2932.         attachments = new ArrayList<Attachment>();
  2933.     }
  2934.     LOG.info("Return Attachment is : "+attachments);
  2935.     return attachments;
  2936.     }
  2937.  
  2938.     protected WebPage getTnCPage() {
  2939.     LOG.debug("#RegisterCustomerPanel.getTnCPage()");
  2940.     String className = "com.sybase365.mobiliser.web.consumer.pages.signup."
  2941.         + "TermsAndConditions_"
  2942.         + getBasePage().getMobiliserWebSession().getLocale()
  2943.             .getLanguage();
  2944.     WebPage wp = new TermsAndConditions_en();
  2945.     try {
  2946.         Class<?> classObj = Class.forName(className);
  2947.         wp = (WebPage) classObj.newInstance();
  2948.     } catch (ClassNotFoundException e) {
  2949.         LOG.error("# Class not Found Exception", e);
  2950.     } catch (IllegalAccessException e) {
  2951.         LOG.error("# IllegalAccessException", e);
  2952.     } catch (InstantiationException e) {
  2953.         LOG.error("# InstantiationException", e);
  2954.     }
  2955.     return wp;
  2956.     }
  2957.  
  2958.     protected void handleBack() {
  2959.     LOG.debug("#RegisterCustomerPanel.handleBack()");
  2960.     setResponsePage(systemCustomerClient.getMobiliserApplication()
  2961.         .getPageInstance(SignupStartPage.class));
  2962.     }
  2963.  
  2964.     protected void handleCancel() {
  2965.     LOG.debug("#RegisterCustomerPanel.handleCancel()");
  2966.     setResponsePage(systemCustomerClient.getMobiliserApplication()
  2967.         .getPageInstance(SignupCancelPage.class));
  2968.     }
  2969.  
  2970.     @SuppressWarnings("boxing")
  2971.     protected void continueSignUp() {
  2972.     try {
  2973.         if (!selectedTermAndConditions
  2974.             .containsAll(requiredTermAndConditions)) {
  2975.         error(getLocalizer().getString(
  2976.             "customer.acceptMandatoryTnc.error", this));
  2977.         return;
  2978.         }
  2979.  
  2980.         if (!systemCustomerClient.uniqueIdentificationCheck(getCustomer()
  2981.             .getMsisdn(), Constants.IDENT_TYPE_MSISDN, getCustomer()
  2982.             .getId(), configuration.getCountryCode()))
  2983.         return;
  2984.         // if (getBasePage().duplicateUsernameCheck(customer))
  2985.         // return;
  2986.         if (!systemCustomerClient.uniqueIdentificationCheck(getCustomer()
  2987.             .getUserName(), Constants.IDENT_TYPE_USERNAME,
  2988.             getCustomer().getId(), configuration.getCountryCode()))
  2989.         return;
  2990.         if (!systemCustomerSecurityClient.checkPasswordStrength(customer))
  2991.         return;
  2992.  
  2993.         if (!systemCustomerSecurityClient.checkPinStrength(customer))
  2994.         return;
  2995.         List<Long> selectedList = new ArrayList<Long>();
  2996.         if (PortalUtils.exists(selectedTermAndConditions)) {
  2997.         for (TermAndCondition l : selectedTermAndConditions)
  2998.             selectedList.add(l.getTncVersionId());
  2999.         }
  3000.  
  3001.         setResponsePage(systemCustomerClient.getMobiliserApplication()
  3002.             .getPageInstance(ConfirmDataPage.class, customer,
  3003.                 this.getWebPage(), selectedList));
  3004.     } catch (Exception e) {
  3005.         LOG.error("#An error occurred while registering a customer", e);
  3006.         error(getLocalizer().getString("register.customer.error", this));
  3007.     }
  3008.  
  3009.     }
  3010.  
  3011.    
  3012.     protected void continueRegistration() {
  3013.     try {
  3014.         customer.setUserName(customer.getAddress().getEmail());
  3015.         LOG.info("username is set to {} from {} ", new Object[]{customer.getUserName(), customer.getAddress().getEmail()} );
  3016.        
  3017.         if( ( customer.getCustomerTypeId() == Constants.CUSTOMER_TYPE_MERCHANT  ||
  3018.                 customer.getCustomerTypeId() == Constants.CUSTOMER_TYPE_AGENT_FINCA_BRANCH ||
  3019.                 customer.getCustomerTypeId() == Constants.CUSTOMER_TYPE_MERCHANT_HEADQUARTER ||
  3020.                 customer.getCustomerTypeId() == Constants.CUSTOMER_TYPE_CST_SUB_AGENT )
  3021.                 && (customer.getUserName() == null || customer.getUserName().isEmpty()) ){
  3022.            
  3023.             LOG.info("We have to make sure that the user gives email address in any case");
  3024.             error(getLocalizer().getString("email.is.mandatory.error", this));
  3025.             return;
  3026.         }
  3027.        
  3028.         //adding exception for cst users
  3029.         if(!(customer.getCustomerTypeId()==Constants.CUSTOMER_TYPE_CST_SUB_AGENT))
  3030.         {
  3031.             if (!systemCustomerClient.uniqueIdentificationCheck(getCustomer()
  3032.                     .getMsisdn(), Constants.IDENT_TYPE_MSISDN, getCustomer()
  3033.                     .getId(), configuration.getCountryCode()))
  3034.                 return;
  3035.         }
  3036.            
  3037.        
  3038.         if(getCustomer().getUserName()!=null){
  3039.             if (!systemCustomerClient.uniqueIdentificationCheck(getCustomer()
  3040.                     .getUserName(), Constants.IDENT_TYPE_USERNAME,
  3041.                     getCustomer().getId(), configuration.getCountryCode())){
  3042.                
  3043.                 LOG.info("Username already taken, please select some other username");
  3044.                 error(getLocalizer().getString("username.duplicate.error", this));
  3045.                 return;
  3046.             }
  3047.         }
  3048.        
  3049.       //adding exception for cst users
  3050.         if(!(customer.getCustomerTypeId()==Constants.CUSTOMER_TYPE_CST_SUB_AGENT))
  3051.         {
  3052.             if(!ValidationUtils.isMobileNumberValid(getCustomer().getMsisdn())){
  3053.                 error(getLocalizer().getString("invalid.mobileNo.format.error", this));
  3054.                     return;
  3055.             }
  3056.             if(!systemCustomClient.uniqueCNICCheck(getCustomer().getIdentityValue())){
  3057.                 LOG.info("duplicate CNIC found in database, returning");
  3058.                 error(getLocalizer().getString("customer.duplicate.cnic.error", this));
  3059.                 return;
  3060.             }  
  3061.         }
  3062.        
  3063.        
  3064.  
  3065.         customer.getAddress().setKvCountry(customer.getKvCountry());
  3066.         setResponsePage(systemCustomerClient
  3067.             .getMobiliserApplication()
  3068.             .getPageInstance(
  3069.                 com.sybase365.mobiliser.web.cst.pages.customercare.ConfirmDataPage.class,
  3070.                 customer, this.getWebPage(),
  3071.                 selectedTermAndConditions));
  3072.     } catch (Exception e) {
  3073.         LOG.error("#An error occurred while registering a customer", e);
  3074.         error(getLocalizer().getString("register.customer.error", this));
  3075.     }
  3076.    
  3077.     }
  3078.  
  3079.     protected boolean isEligible() {
  3080.     if (PortalUtils.exists(customer.getBirthDateString())) {
  3081.         Calendar cc = Calendar.getInstance();
  3082.         cc.setTimeInMillis(System.currentTimeMillis());
  3083.         cc.set(Calendar.YEAR, cc.get(Calendar.YEAR) - 18);
  3084.         Calendar c = customer.getBirthDateAsXml().toGregorianCalendar();
  3085.  
  3086.         if (c.after(cc)) {
  3087.         error(getLocalizer().getString("customer.age.error", this));
  3088.         captcha = "";
  3089.         return false;
  3090.         }
  3091.         return true;
  3092.     }
  3093.     return false;
  3094.     }
  3095.  
  3096.    
  3097.     protected boolean isEligibleCNICExpiry() {
  3098.         if (PortalUtils.exists(customer.getCnicExpiryDateString())) {
  3099.             Calendar cc = Calendar.getInstance();
  3100.             cc.setTimeInMillis(System.currentTimeMillis());
  3101.             cc.set(Calendar.YEAR, cc.get(Calendar.YEAR));
  3102.             Calendar c = customer.getCnicExpiryDateAsXml().toGregorianCalendar();
  3103.  
  3104.             if (c.before(cc)) {
  3105.             error(getLocalizer().getString("customer.cnic.expiry.error", this));
  3106.             captcha = "";
  3107.             return false;
  3108.             }
  3109.             return true;
  3110.         }
  3111.         return false;
  3112.         }
  3113.    
  3114.    
  3115.    
  3116.     public String getPinConfirmed() {
  3117.     return pinConfirmed;
  3118.     }
  3119.  
  3120.     public void setPinConfirmed(String pinConfirmed) {
  3121.     this.pinConfirmed = pinConfirmed;
  3122.     }
  3123.  
  3124.     public String getPasswordConfirmed() {
  3125.     return passwordConfirmed;
  3126.     }
  3127.  
  3128.     public void setPasswordConfirmed(String passwordConfirmed) {
  3129.     this.passwordConfirmed = passwordConfirmed;
  3130.     }
  3131.  
  3132.     public String getCaptcha() {
  3133.     return captcha;
  3134.     }
  3135.  
  3136.     public void setCaptcha(String captcha) {
  3137.     this.captcha = captcha;
  3138.     }
  3139.  
  3140.     public String getConditions() {
  3141.     return conditions;
  3142.     }
  3143.  
  3144.     public void setConditions(String conditions) {
  3145.     this.conditions = conditions;
  3146.     }
  3147.  
  3148.     public boolean isSelected() {
  3149.     return selected;
  3150.     }
  3151.  
  3152.     public void setSelected(boolean selected) {
  3153.     this.selected = selected;
  3154.     }
  3155.  
  3156.     /*Customization for Notification*/
  3157.      protected void sendSMSNotification() {
  3158.         try {
  3159.  
  3160.             Map paramMap = new Map();              
  3161.            
  3162.             Entry aliasName = new Entry();
  3163.             aliasName.setKey("name");
  3164.             aliasName.setValue(customer.getDisplayName());
  3165.            
  3166.             Entry aliasIBAN = new Entry();
  3167.             aliasIBAN.setKey("iban");
  3168.             aliasIBAN.setValue(customer.getIban());
  3169.                            
  3170.             paramMap.getEntry().add(aliasName);
  3171.             paramMap.getEntry().add(aliasIBAN);
  3172.            
  3173.             CommonFunctions.sendSms(paramMap, "TEMPLATE_FOR_ACCOUNT_REGISTRATION",customer.getMsisdn(),systemMessageClient);  
  3174.            
  3175.         } catch (Exception e) {
  3176.             LOG.error("An error occured in sending Agent Registration notification", e.getMessage());
  3177.             //e.printStackTrace();
  3178.         }
  3179.      }
  3180.      /*Customization for Notification*/
  3181.    
  3182. //    private List<String> getLanguageListDropDown(){
  3183. //      List<String> langList = new ArrayList<String>();
  3184. //      langList.add(configuration.getLanguage());
  3185. //      return langList;
  3186. //    }
  3187. //    
  3188. //    private List<String> getTimeZoeListDropDown(){
  3189. //      List<String> timeList = new ArrayList<String>();
  3190. //      timeList.add(configuration.getDefaultTime());
  3191. //      return timeList;
  3192. //    }
  3193. //    
  3194. //    private List<String> getCountryListDropDown(){
  3195. //      List<String> countryList = new ArrayList<String>();
  3196. //      countryList.add(configuration.getCountryId());
  3197. //      return countryList;
  3198. //    }
  3199. //    
  3200. //    private List<Integer> getIdentityListDropDown(){
  3201. //      List<Integer> identityList = new ArrayList<Integer>();
  3202. //      identityList.add(configuration.getIdentityTypes());
  3203. ////        identityList.add(configuration.getIdentityTypes());
  3204. //      return identityList;
  3205. //    }
  3206. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement