/** * Open the Other Files. */ public void openOtherRecords() { super.openOtherRecords(); new ProfileControl(this); } /**
TourModel recTour = (TourModel)Record.makeRecordFromClassName(TourModel.THICK_CLASS, recordOwner); BookingControl recBookingControl = new BookingControl(recordOwner); ProfileControl recProfileControl = new ProfileControl(recordOwner); recBooking.addControlDefaults(recBookingControl, recProfileControl); ex.printStackTrace(); } finally { recProfileControl.free(); recBookingControl.free(); recTour.free();
/** * Add all the screen listeners. */ public void addListeners() { super.addListeners(); this.addMainKeyBehavior(); Profile recProfile = (Profile)this.getRecord(Profile.PROFILE_FILE); ProfileControl recProfileControl = (ProfileControl)this.getRecord(ProfileControl.PROFILE_CONTROL_FILE); try { recProfileControl.open(); // Read the control file recProfile.getField(Profile.PROFILE_STATUS_ID).addListener(new InitFieldHandler(recProfileControl.getField(ProfileControl.DEFAULT_PROFILE_STATUS_ID))); recProfile.getField(Profile.PROFILE_CLASS_ID).addListener(new InitFieldHandler(recProfileControl.getField(ProfileControl.DEFAULT_PROFILE_CLASS_ID))); recProfile.getField(Profile.PROFILE_TYPE_ID).addListener(new InitFieldHandler(recProfileControl.getField(ProfileControl.DEFAULT_PROFILE_TYPE_ID))); recProfile.getField(Profile.COUNTRY_ID).addListener(new InitFieldHandler(recProfileControl.getField(ProfileControl.COUNTRY_ID))); recProfile.getField(Profile.PRIMARY_LANGUAGE_ID).addListener(new InitFieldHandler(recProfileControl.getField(ProfileControl.LANGUAGE_ID))); recProfile.getField(Profile.CURRENCYS_ID).addListener(new InitFieldHandler(recProfileControl.getField(ProfileControl.CURRENCYS_ID))); } catch (DBException ex) { ex.printStackTrace(); } Record recCountry = ((ReferenceField)recProfile.getField(Profile.COUNTRY_ID)).getReferenceRecord(); recProfile.getField(Profile.COUNTRY_ID).addListener(new MoveOnChangeHandler(recProfile.getField(Profile.COUNTRY), recCountry.getField(Country.NAME))); recProfile.getField(Profile.COUNTRY_ID).addListener(new MoveOnChangeHandler(recProfile.getField(Profile.PRIMARY_LANGUAGE_ID), recCountry.getField(Country.LANGUAGE_ID))); recProfile.getField(Profile.COUNTRY_ID).addListener(new MoveOnChangeHandler(recProfile.getField(Profile.CURRENCYS_ID), recCountry.getField(Country.CURRENCYS_ID))); } /**
/** * Override this to open the other files in the query. */ public void openOtherRecords() { super.openOtherRecords(); new BookingControl(this); new ProfileControl(this); Record recBooking = this.getMainRecord(); Record recTour = ((ReferenceField)recBooking.getField(Booking.TOUR_ID)).getReferenceRecord(this); recTour.setOpenMode((recTour.getOpenMode() & ~DBConstants.OPEN_READ_ONLY) | DBConstants.OPEN_LOCK_ON_CHANGE_STRATEGY); Record recTourHeader = ((ReferenceField)recTour.getField(Tour.TOUR_HEADER_ID)).getReferenceRecord(this); } /**
recProfileControl = new ProfileControl(this.findRecordOwner()); this.addListener(new FreeOnFreeHandler(recProfileControl));