if (iDisplayFieldSeq == null) iDisplayFieldSeq = ((Record)record).getDefaultDisplayFieldName(); FieldConverter convert = new QueryConverter((Converter)converter, (Record)record, iDisplayFieldSeq, bIncludeBlankOption); ScreenComponent screenField = createScreenComponent(ScreenModel.POPUP_BOX, itsLocation, targetScreen, convert, iDisplayFieldDesc, null); if (bIncludeFormButton)
/** * Add a popup for the table tied to this field. * Key must be the first and primary and only key. * @param record Record to display in a popup * @param iQueryKeySeq Order to display the record (-1 = Primary field) * @param iDisplayFieldSeq Description field for the popup (-1 = second field) * @param bIncludeBlankOption Include a blank option in the popup? * @return Return the component or ScreenField that is created for this field. */ public ScreenField setupTablePopup(ScreenLocation itsLocation, BasePanel targetScreen, Converter converter, int iDisplayFieldDesc, Record record, int iQueryKeySeq, int iDisplayFieldSeq, boolean bIncludeBlankOption, boolean bIncludeFormButton) { if ((!(this instanceof ReferenceField)) && (!(this instanceof CounterField))) Debug.doAssert(false); // error, wrong field type record.setKeyArea(iQueryKeySeq); record.close(); if (converter == null) converter = this; if (iDisplayFieldSeq == -1) iDisplayFieldSeq = record.getDefaultDisplayFieldSeq(); FieldConverter convert = new QueryConverter(converter, record, iDisplayFieldSeq, bIncludeBlankOption); ScreenField screenField = new SPopupBox(itsLocation, targetScreen, convert, iDisplayFieldDesc); if (bIncludeFormButton) if (!(targetScreen instanceof BaseGridScreen)) new SCannedBox(targetScreen.getNextLocation(ScreenConstants.RIGHT_OF_LAST, ScreenConstants.DONT_SET_ANCHOR), targetScreen, converter, ThinMenuConstants.FORM, ScreenConstants.DONT_DISPLAY_FIELD_DESC, record); record.selectScreenFields(); // Only select fields that you will display return screenField; } /**
/** * Add a popup for the table tied to this field. * Key must be the first and primary and only key. * @param record Record to display in a popup * @param iQueryKeySeq Order to display the record (-1 = Primary field) * @param iDisplayFieldSeq Description field for the popup (-1 = second field) * @param bIncludeBlankOption Include a blank option in the popup? * @return Return the component or ScreenField that is created for this field. */ public ScreenField setupTablePopup(ScreenLocation itsLocation, BasePanel targetScreen, Converter converter, int iDisplayFieldDesc, Record record, int iQueryKeySeq, int iDisplayFieldSeq, boolean bIncludeBlankOption, boolean bIncludeFormButton) { if ((!(this instanceof ReferenceField)) && (!(this instanceof CounterField))) Debug.doAssert(false); // error, wrong field type record.setKeyArea(iQueryKeySeq); record.close(); if (converter == null) converter = this; if (iDisplayFieldSeq == -1) iDisplayFieldSeq = record.getDefaultDisplayFieldSeq(); FieldConverter convert = new QueryConverter(converter, record, iDisplayFieldSeq, bIncludeBlankOption); ScreenField screenField = new SPopupBox(itsLocation, targetScreen, convert, iDisplayFieldDesc); if (bIncludeFormButton) if (!(targetScreen instanceof BaseGridScreen)) new SCannedBox(targetScreen.getNextLocation(ScreenConstants.RIGHT_OF_LAST, ScreenConstants.DONT_SET_ANCHOR), targetScreen, converter, ThinMenuConstants.FORM, ScreenConstants.DONT_DISPLAY_FIELD_DESC, record); record.selectScreenFields(); // Only select fields that you will display return screenField; } /**
/** * Add the tour departure toolbar. */ public ToolScreen addTourToolbar(BasePanel parentScreen) { ToolScreen toolScreen = new EmptyToolbar(null, parentScreen, null, ScreenConstants.DONT_DISPLAY_FIELD_DESC, null); this.getField(LookupScreenRecord.TOUR_HDR_END_DATE).setupDefaultView(toolScreen.getNextLocation(ScreenConstants.NEXT_INPUT_LOCATION, ScreenConstants.AT_ANCHOR), toolScreen, ScreenConstants.DEFAULT_DISPLAY); this.getField(LookupScreenRecord.TOUR_HDR_TOUR_TYPE).setupDefaultView(toolScreen.getNextLocation(ScreenConstants.RIGHT_WITH_DESC, ScreenConstants.AT_ANCHOR), toolScreen, ScreenConstants.DEFAULT_DISPLAY); TourHeader recTourHeader = (TourHeader)((ReferenceField)this.getField(LookupScreenRecord.TOUR_HEADER_ID)).getReferenceRecord(); QueryConverter tourHdrConv = new QueryConverter((ReferenceField)this.getField(LookupScreenRecord.TOUR_HEADER_ID), recTourHeader, TourHeader.DESCRIPTION, true); BaseField fldDepartureDate = this.getField(LookupScreenRecord.DEPARTURE_DATE); BaseField fldStartDate = this.getField(LookupScreenRecord.START_TARGET_DATE); BaseField fldEndDate = this.getField(LookupScreenRecord.END_TARGET_DATE); recTourHeader.createTourHeaderPopup(toolScreen.getNextLocation(ScreenConstants.NEXT_INPUT_LOCATION, ScreenConstants.ANCHOR_DEFAULT), toolScreen, tourHdrConv, ScreenConstants.DEFAULT_DISPLAY, fldDepartureDate, fldStartDate, fldEndDate, null); this.getField(LookupScreenRecord.TOUR_STATUS_ID).setupDefaultView(toolScreen.getNextLocation(ScreenConstants.RIGHT_WITH_DESC, ScreenConstants.AT_ANCHOR), toolScreen, ScreenConstants.DEFAULT_DISPLAY); return toolScreen; } /**
QueryConverter tourHdrConv = new QueryConverter((ReferenceField)this.getScreenRecord().getField(TourEntryScreenRecord.TOUR_HEADER_ID), recTourHeader, TourHeader.DESCRIPTION, true); recTourHeader.createTourHeaderPopup(this.getNextLocation(ScreenConstants.RIGHT_OF_LAST, ScreenConstants.ANCHOR_DEFAULT), this, tourHdrConv, ScreenConstants.DONT_DISPLAY_FIELD_DESC, fldDepartureDate, fldStartDate, fldEndDate, recBookingControl.getField(BookingControl.TOUR_HEADER_TOUR_TYPE));