View Single Post
Old 07-16-2008, 03:08 AM   #5 (permalink)
myworldntl
New Member
 
Join Date: Jul 2008
Model: none
PIN: N/A
Carrier: none
Posts: 3
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Thanks

Hi,

Thanks everyone, double checked everything as suggested and seemed to get it working...

Main problem is i have no idea about java or the JDE atm, so it's very much a learning experience, lol.

Thanks for all your help though, now i just need to figure out how to get everything else to work that i want it to do, lol, but I need to walk before i can run right, ha ha :D

Anyhow, this is the updated code which now works, and thanks again.

Code:
package com.rim.samples.Simon_Test;

import net.rim.device.api.ui.*;
import net.rim.device.api.ui.component.*;
import net.rim.device.api.ui.container.*;
import net.rim.device.api.system.*;
import net.rim.device.api.i18n.*;



public class Lombard extends UiApplication
{
        public static void main(String[] args)
        {
                Lombard app = new Lombard();
                app.enterEventDispatcher();
        }

        public Lombard()
        {
                pushScreen(new LombardScreen());
        }
}


final class LombardScreen extends MainScreen
{
//Gender (for sales margin)
private ObjectChoiceField genderChoice;

//Name
private ObjectChoiceField partnerNameChoice;

//Can the investment to be in Goldlist?
private ObjectChoiceField goldlistChoice;

//Selected Premium/Fund - Establishment Charge
private ObjectChoiceField premfunEstChargeChoice;

//Selected Premium/Fund - Surrender penalty (value not year dependent)
private ObjectChoiceField premfunSurrPenChoice;

//Premium Currency
private ObjectChoiceField currencyChoice;

//Premium Frequency
private ObjectChoiceField premFreqChoice;

//Taken As - Partial Surrenders (only for single premium policies)
private ObjectChoiceField takenAsPartialSurrChoice;





public LombardScreen()
        {
                super();

                LabelField title = new LabelField("Lombard Demo", LabelField.ELLIPSIS | LabelField.USE_ALL_WIDTH);
                setTitle(title);
                
                LabelField header1 = new LabelField("Client Details: -", LabelField.ELLIPSIS | LabelField.USE_ALL_WIDTH);
                add(header1);
                
                //Seperator
                SeparatorField myLine = new SeparatorField(SeparatorField.LINE_HORIZONTAL);
                add(myLine);

                //Client Name
                AutoTextEditField clientNameText = new AutoTextEditField("Client Name: ", "");
                add(clientNameText);                               
                
                //Age
                EditField ageValue = new EditField("Age: ", "");
                add(ageValue);
                
                //Gender
                String choices1[] = {"Male", "Female"};
                genderChoice = new ObjectChoiceField("Gender", choices1);
                add(genderChoice);
                
                //HEADER & Seperators - Product Details
                SeparatorField header2Top = new SeparatorField(SeparatorField.LINE_HORIZONTAL);
                add(header2Top);
                LabelField header2 = new LabelField("Product Details: -");
                add(header2);
                SeparatorField header2Bot = new SeparatorField(SeparatorField.LINE_HORIZONTAL);
                add(header2Bot);
                
                
                //Product name
                AutoTextEditField prodNameText = new AutoTextEditField("Product name: ", "");
                add(prodNameText);

                //HEADER & Seperators - IFA Details
                SeparatorField header3Top = new SeparatorField(SeparatorField.LINE_HORIZONTAL);
                add(header3Top);
                LabelField header3 = new LabelField("IFA Details: -");
                add(header3);
                SeparatorField header3Bot = new SeparatorField(SeparatorField.LINE_HORIZONTAL);
                add(header3Bot);

                //Name
                String choices2[] = {"Partner 1", "Partner 2", "Partner 3", "Partner 4", "Partner 5", "Partner 6", "Partner 7", "Partner 8", "Partner 9", "Partner 10", "Partner 11", "Partner 12", "Partner 13", "Partner 14", "Other"};
                partnerNameChoice = new ObjectChoiceField("Name", choices2);
                                add(partnerNameChoice);
                //Name
                AutoTextEditField partnerNameText = new AutoTextEditField("Name: ", "");
                add(partnerNameText);
                
                //Address
                AutoTextEditField addressText = new AutoTextEditField("Address: ", "");
                add(addressText);
                
                //Telephone Number
                BasicEditField telNumberText = new AutoTextEditField("Telephone Number: ", "");
                add(telNumberText);

                //HEADER & Seperators - Fund Details
                SeparatorField header4Top = new SeparatorField(SeparatorField.LINE_HORIZONTAL);
                add(header4Top);
                LabelField header4 = new LabelField("Fund Details: -");
                add(header4);
                SeparatorField header4Bot = new SeparatorField(SeparatorField.LINE_HORIZONTAL);
                add(header4Bot);


                //Can the investment to be in Goldlist?
                String choices3[] = {"No", "Yes"};
                goldlistChoice = new ObjectChoiceField("Can invest in Goldlist?", choices3);
                                add(goldlistChoice);
                
                //HEADER & Seperators - Charges
                SeparatorField header5Top = new SeparatorField(SeparatorField.LINE_HORIZONTAL);
                add(header5Top);
                LabelField header5 = new LabelField("Charges: -");
                add(header5);
                SeparatorField header5Bot = new SeparatorField(SeparatorField.LINE_HORIZONTAL);
                add(header5Bot);                
                
                //Broker Initial Commission
                EditField initialCommValue = new EditField("Broker Initial Commission: ", "");
                add(initialCommValue);
                
                //Allocation Rate
                EditField allocationRateValue = new EditField("Allocation Rate: ", "");
                add(allocationRateValue);
                
                //Bid/Offer Spread
                EditField bidOfferSpreadValue = new EditField("Bid/Offer Spread: ", "");
                add(bidOfferSpreadValue);
                
                //Guaranteed Administration Charge
                EditField adminChargeValue = new EditField("Guaranteed Administration Charge: ", "");
                add(adminChargeValue);
                
                //Selected Months - Guaranteed Administration Charge
                EditField monthsAdminChargeValue = new EditField("Guaranteed Administration Charge: ", "");
                add(monthsAdminChargeValue);
                
                //Underlying asset charges (e.g. on mutual fund)A
                EditField assestChargeAValue = new EditField("Underlying asset charges (e.g. on mutual fund)A: ", "");
                add(assestChargeAValue);
                
                //Underlying asset charges (e.g. on mutual fund)B
                EditField assestChargeBValue = new EditField("Underlying asset charges (e.g. on mutual fund)B: ", "");
                add(assestChargeBValue);
                
                //Renewal Commission
                EditField renCommissionValue = new EditField("Renewal Commission: ", "");
                add(renCommissionValue);
                
                //Investment Advisory Fee
                EditField AdFeeValue = new EditField("Investment Advisory Fee: ", "");
                add(AdFeeValue);
                
                //Establishment Charge
                EditField estChargeValue = new EditField("Establishment Charge: ", "");
                add(estChargeValue);
                
                //Selected Months - Establishment Charge
                EditField monthsEstChargeValue = new EditField("Establishment Charge: ", "");
                add(monthsEstChargeValue);
                
                //Selected Premium/Fund - Establishment Charge
                String choices4[] = {"Premium", "Fund"};
                premfunEstChargeChoice = new ObjectChoiceField("Establishment Charge", choices4);
                add(premfunEstChargeChoice);
                
                //Policy Fee
                EditField policyFeeValue = new EditField("Policy Fee: ", "");
                add(policyFeeValue);
                
                //Surrender penalty (value not year dependent)
                EditField surrPenValue = new EditField("Surrender penalty (value not year dependent): ", "");
                add(surrPenValue);
                
                //Selected Months - Surrender penalty (value not year dependent)
                EditField monthsSurrPenValue = new EditField("Surrender penalty (value not year dependent): ", "");
                add(monthsSurrPenValue);
                
                //Selected Premium/Fund - Surrender penalty (value not year dependent)
                String choices5[] = {"Premium", "Fund"};
                premfunSurrPenChoice = new ObjectChoiceField("Surrender penalty (value not year dependent)", choices5);
                add(premfunSurrPenChoice);
                
                //Surrender Penalty at end of year t
                EditField surrPenEoyValue = new EditField("Surrender Penalty at end of year t: ", "");
                add(surrPenEoyValue);
                
                //% of Premium - Surrender Penalty at end of year t
                EditField perOfPremiumSurrPenEoyValue = new EditField("Surrender Penalty at end of year t: ", "");
                add(perOfPremiumSurrPenEoyValue);
                
                //Trailer fee to LIA (for sales margin check):
                EditField trailerFeeValue = new EditField("Trailer fee to LIA (for sales margin check): ", "");
                add(trailerFeeValue);

                //HEADER & Seperators - Other Assumptions
                SeparatorField header6Top = new SeparatorField(SeparatorField.LINE_HORIZONTAL);
                add(header6Top);
                LabelField header6 = new LabelField("Other Assumptions: -");
                add(header6);
                SeparatorField header6Bot = new SeparatorField(SeparatorField.LINE_HORIZONTAL);
                add(header6Bot);

                //Premium
                EditField premiumValue = new EditField("Premium: ", "");
                add(premiumValue);
                
                //Premium Currency
                String choices6[] = {"ARP", "ATS", "AUD", "BEF", "CAD", "CHF", "DEM", "DKK", "ESP", "EUR", "FIM", "GBP", "FRF", "GRD", "IEP", "ITL", "JPY", "LUF", "NLG", "NOK", "NZD", "PTE", "SEK", "USD", "ZAR"};
                currencyChoice = new ObjectChoiceField("Premium Currency", choices6);
                add(currencyChoice);

                //Premium Frequency
                String choices7[] = {"Single", "Monthly", "Quarterly", "Twice Yearly", "Annually"};
                premFreqChoice = new ObjectChoiceField("Premium Frequency", choices7);
                add(premFreqChoice);

                
                //Premium Term (only for non-single premium)
                EditField premTermValue = new EditField("Premium Term (only for non-single premium): ", "");
                add(premTermValue);
                
                //Partial Surrenders (only for single premium policies)
                EditField partialSurrValue = new EditField("Partial Surrenders (only for single premium policies): ", "");
                add(partialSurrValue);
                
                
                //Taken As - Partial Surrenders (only for single premium policies)
                String choices8[] = {"Monthly", "Quarterly", "Twice Yearly", "Annually"};
                takenAsPartialSurrChoice = new ObjectChoiceField("", choices8);
                add(takenAsPartialSurrChoice);                
         }

        //override onClose() to display a dialog box when the application is closed
        public boolean onClose()
        {
                Dialog.alert("Goodbye!");
                System.exit(0);
                return true;
                }

private MenuItem _closeItem = new MenuItem("Close", 200000, 10) {
                public void run()
                {
                        onClose();
                }
        };

        //override makeMenu to add the new menu items
        protected void makeMenu( Menu menu, int instance )
        {
                menu.add(_closeItem);
        }


}
Offline   Reply With Quote