/** * AddSecondProfile Method. */ public void addSecondProfile(Record recProfile) { ReadSecondaryHandler behavior = new ReadSecondaryHandler(recProfile, Profile.PROFILE_CODE_KEY); behavior.setRespondsToMode(DBConstants.READ_MOVE, false); this.getField(Booking.PROFILE_CODE).addListener(behavior); behavior.addFieldSeqPair(Booking.PROFILE_ID, Profile.ID, DBConstants.MOVE_TO_DEPENDENT, DBConstants.DONT_MOVE_DEPENDENT_BACK); behavior.addFieldSeqPair(Booking.PROFILE_CODE, Profile.PROFILE_CODE, DBConstants.MOVE_TO_DEPENDENT, DBConstants.DONT_MOVE_DEPENDENT_BACK); behavior.addFieldSeqPair(Booking.GENERIC_NAME, Profile.GENERIC_NAME, DBConstants.MOVE_TO_DEPENDENT, DBConstants.MOVE_DEPENDENT_BACK); behavior.addFieldSeqPair(Booking.ADDRESS_LINE_1, Profile.ADDRESS_LINE_1, DBConstants.MOVE_TO_DEPENDENT, DBConstants.MOVE_DEPENDENT_BACK); behavior.addFieldSeqPair(Booking.ADDRESS_LINE_2, Profile.ADDRESS_LINE_2, DBConstants.MOVE_TO_DEPENDENT, DBConstants.MOVE_DEPENDENT_BACK); behavior.addFieldSeqPair(Booking.CITY_OR_TOWN, Profile.CITY_OR_TOWN, DBConstants.MOVE_TO_DEPENDENT, DBConstants.MOVE_DEPENDENT_BACK); behavior.addFieldSeqPair(Booking.COUNTRY, Profile.COUNTRY, DBConstants.MOVE_TO_DEPENDENT, DBConstants.MOVE_DEPENDENT_BACK); behavior.addFieldSeqPair(Booking.STATE_OR_REGION, Profile.STATE_OR_REGION, DBConstants.MOVE_TO_DEPENDENT, DBConstants.MOVE_DEPENDENT_BACK); behavior.addFieldSeqPair(Booking.POSTAL_CODE, Profile.POSTAL_CODE, DBConstants.MOVE_TO_DEPENDENT, DBConstants.MOVE_DEPENDENT_BACK); behavior.addFieldSeqPair(Booking.TEL, Profile.TEL, DBConstants.MOVE_TO_DEPENDENT, DBConstants.MOVE_DEPENDENT_BACK); behavior.addFieldSeqPair(Booking.FAX, Profile.FAX, DBConstants.MOVE_TO_DEPENDENT, DBConstants.MOVE_DEPENDENT_BACK); behavior.addFieldSeqPair(Booking.EMAIL, Profile.EMAIL, DBConstants.MOVE_TO_DEPENDENT, DBConstants.MOVE_DEPENDENT_BACK); behavior.addFieldSeqPair(Booking.LANGUAGE_ID, Profile.PRIMARY_LANGUAGE_ID, DBConstants.MOVE_TO_DEPENDENT, DBConstants.MOVE_DEPENDENT_BACK); behavior.addFieldSeqPair(Booking.CURRENCYS_ID, Profile.CURRENCYS_ID, DBConstants.MOVE_TO_DEPENDENT, DBConstants.MOVE_DEPENDENT_BACK); // Only move contact if not blank Converter convTrueIfContactNotBlank = new RadioConverter(this.getField(Booking.CONTACT), DBConstants.BLANK, true); recProfile.addListener(new RemoveConverterOnCloseHandler(convTrueIfContactNotBlank)); MoveOnValidHandler moveHandler = behavior.addFieldSeqPair(Booking.CONTACT, Profile.CONTACT, DBConstants.MOVE_TO_DEPENDENT, DBConstants.DONT_MOVE_DEPENDENT_BACK, convTrueIfContactNotBlank, null); moveHandler.setDisableOnMove(false); } /**
/** * AddSecondProfile Method. */ public void addSecondProfile(Record recProfile) { ReadSecondaryHandler behavior = new ReadSecondaryHandler(recProfile, Profile.PROFILE_CODE_KEY); behavior.setRespondsToMode(DBConstants.READ_MOVE, false); this.getField(Booking.PROFILE_CODE).addListener(behavior); behavior.addFieldSeqPair(Booking.PROFILE_ID, Profile.ID, DBConstants.MOVE_TO_DEPENDENT, DBConstants.DONT_MOVE_DEPENDENT_BACK); behavior.addFieldSeqPair(Booking.PROFILE_CODE, Profile.PROFILE_CODE, DBConstants.MOVE_TO_DEPENDENT, DBConstants.DONT_MOVE_DEPENDENT_BACK); behavior.addFieldSeqPair(Booking.GENERIC_NAME, Profile.GENERIC_NAME, DBConstants.MOVE_TO_DEPENDENT, DBConstants.MOVE_DEPENDENT_BACK); behavior.addFieldSeqPair(Booking.ADDRESS_LINE_1, Profile.ADDRESS_LINE_1, DBConstants.MOVE_TO_DEPENDENT, DBConstants.MOVE_DEPENDENT_BACK); behavior.addFieldSeqPair(Booking.ADDRESS_LINE_2, Profile.ADDRESS_LINE_2, DBConstants.MOVE_TO_DEPENDENT, DBConstants.MOVE_DEPENDENT_BACK); behavior.addFieldSeqPair(Booking.CITY_OR_TOWN, Profile.CITY_OR_TOWN, DBConstants.MOVE_TO_DEPENDENT, DBConstants.MOVE_DEPENDENT_BACK); behavior.addFieldSeqPair(Booking.COUNTRY, Profile.COUNTRY, DBConstants.MOVE_TO_DEPENDENT, DBConstants.MOVE_DEPENDENT_BACK); behavior.addFieldSeqPair(Booking.STATE_OR_REGION, Profile.STATE_OR_REGION, DBConstants.MOVE_TO_DEPENDENT, DBConstants.MOVE_DEPENDENT_BACK); behavior.addFieldSeqPair(Booking.POSTAL_CODE, Profile.POSTAL_CODE, DBConstants.MOVE_TO_DEPENDENT, DBConstants.MOVE_DEPENDENT_BACK); behavior.addFieldSeqPair(Booking.TEL, Profile.TEL, DBConstants.MOVE_TO_DEPENDENT, DBConstants.MOVE_DEPENDENT_BACK); behavior.addFieldSeqPair(Booking.FAX, Profile.FAX, DBConstants.MOVE_TO_DEPENDENT, DBConstants.MOVE_DEPENDENT_BACK); behavior.addFieldSeqPair(Booking.EMAIL, Profile.EMAIL, DBConstants.MOVE_TO_DEPENDENT, DBConstants.MOVE_DEPENDENT_BACK); behavior.addFieldSeqPair(Booking.LANGUAGE_ID, Profile.PRIMARY_LANGUAGE_ID, DBConstants.MOVE_TO_DEPENDENT, DBConstants.MOVE_DEPENDENT_BACK); behavior.addFieldSeqPair(Booking.CURRENCYS_ID, Profile.CURRENCYS_ID, DBConstants.MOVE_TO_DEPENDENT, DBConstants.MOVE_DEPENDENT_BACK); // Only move contact if not blank Converter convTrueIfContactNotBlank = new RadioConverter(this.getField(Booking.CONTACT), DBConstants.BLANK, true); recProfile.addListener(new RemoveConverterOnCloseHandler(convTrueIfContactNotBlank)); MoveOnValidHandler moveHandler = behavior.addFieldSeqPair(Booking.CONTACT, Profile.CONTACT, DBConstants.MOVE_TO_DEPENDENT, DBConstants.DONT_MOVE_DEPENDENT_BACK, convTrueIfContactNotBlank, null); moveHandler.setDisableOnMove(false); } /**
this.getMainRecord().addListener(new FreeOnFreeHandler(recApTrx2)); ReadSecondaryHandler listener = new ReadSecondaryHandler(recVendor2); listener.setRespondsToMode(DBConstants.READ_MOVE, false); listener.setRespondsToMode(DBConstants.INIT_MOVE, false); this.getRecord(ApTrx.AP_TRX_FILE).getField(ApTrx.DRAFT_VENDOR_ID).addListener(listener); recVendor2.addListener(new RecountOnValidHandler(recApTrx2));
this.getMainRecord().addListener(new FreeOnFreeHandler(recApTrx2)); ReadSecondaryHandler listener = new ReadSecondaryHandler(recVendor2); listener.setRespondsToMode(DBConstants.READ_MOVE, false); listener.setRespondsToMode(DBConstants.INIT_MOVE, false); this.getRecord(ApTrx.AP_TRX_FILE).getField(ApTrx.DRAFT_VENDOR_ID).addListener(listener); recVendor2.addListener(new RecountOnValidHandler(recApTrx2));
this.getMainRecord().addListener(new FreeOnFreeHandler(recApTrx2)); ReadSecondaryHandler listener = new ReadSecondaryHandler(recVendor2); listener.setRespondsToMode(DBConstants.READ_MOVE, false); listener.setRespondsToMode(DBConstants.INIT_MOVE, false); this.getRecord(ApTrx.AP_TRX_FILE).getField(ApTrx.DRAFT_VENDOR_ID).addListener(listener); recVendor2.addListener(new RecountOnValidHandler(recApTrx2));
this.getMainRecord().addListener(new FreeOnFreeHandler(recApTrx2)); ReadSecondaryHandler listener = new ReadSecondaryHandler(recVendor2); listener.setRespondsToMode(DBConstants.READ_MOVE, false); listener.setRespondsToMode(DBConstants.INIT_MOVE, false); this.getRecord(ApTrx.AP_TRX_FILE).getField(ApTrx.DRAFT_VENDOR_ID).addListener(listener); recVendor2.addListener(new RecountOnValidHandler(recApTrx2));
pSecondaryBehavior.setRespondsToMode(DBConstants.READ_MOVE, false); recRequest.getField(Request.PROFILE_CODE).addListener(pSecondaryBehavior);
pSecondaryBehavior.setRespondsToMode(DBConstants.READ_MOVE, false); recRequest.getField(Request.PROFILE_CODE).addListener(pSecondaryBehavior);