asapltda Posted April 5, 2014 Posted April 5, 2014 Official Call Example Application Data between two forms : Good morning , this is to request a sample that is very common in the forum. 1. The common procedure is that a generic form is called from another form MainForm Example Two . The Generic Form display the information in a table which is required to obtain a code . example QueryForm Three . In the MainForm form is required to consult the table of Cities , the required code must be entered in field TEDIT . April . Button to see the list of cities is pressed, the program calls the QueryForm.showmodal shape and should expect the user to select the city code , when the user selects the city should receive the selected value and place it on the field TEDIT I have seen several example callback , but in the process in many ways consulting many fields of many different tables are required and requires reuse the code , so I solicto detailed to do this example and if I may suggest is part of the examples official PS In my case in the normal VCL believes tedit a derivative of a function executing this component and thus saving a lot of work Salute and thank you for your attention 1 Quote
joriolm Posted April 12, 2015 Posted April 12, 2015 Hi logisticasoft, Just struggling with this exactly as you mentioned. This is an all day VCL operation, but causing me some new white hair in UniGui.... any ideas? Well, I went to fast in my reply, just saw Form callback demo. Quote
Skepsis IT Posted April 14, 2015 Posted April 14, 2015 Hi to all, if I understand well there is a need for a form displaying some data from a query and then the selected value returns to a tedit in the main form.For this I've made a dialog form that when I call it I pass the query that produces the results and then I return the value that I want using modal result.Correct me If I don't understand well. Quote
wilton_educasoft Posted May 19, 2015 Posted May 19, 2015 see exemple: procedure TfrmClientesProspecao.btnpesqClienteClick(Sender: TObject); begin frmMyFind.ShowModal( procedure (Sender:TComponent;Resp:integer) begin if resp=1 then begin qOcorrenciaCodCliente.AsInteger :=strtointdef(SeparaResult(UniMainModule.global_UtimoRetornoPesquisa,1,'|'),0); qOcorrencianomefantasia.AsString :=separaResult(UniMainModule.global_UtimoRetornoPesquisa,2,'|'); end; end ); procedure TfrmMyFind.btnOKClick(Sender: TObject); begin UniMainModule.global_UtimoRetornoPesquisa :=qFind.fields[0].asstring+'|'+qFind.fields[1].asString; ModalResult :=mrOk; close; end; end; Quote
ogaere Posted July 20, 2015 Posted July 20, 2015 You definitely can do from the closing of the search form type TfrmCourseSearch = class(TUniForm) ... private procedure SetCourseOfferID(OfferID: integer); function GetCourseOfferID: integer; procedure FilterCourse(editComponent: TUniEdit; FieldToSearch : String); public property OfferID: integer read GetCourseOfferID write SetCourseOfferID; end; //---- procedure TfrmCourseSearch.UniFormClose(Sender: TObject; var Action: TCloseAction); begin if ModalResult = mrOK then begin frmCourseEnrollment.cdsRegistrationDet.Edit; frmCourseEnrollment.cdsRegistrationDetCSOFFERINGID.value := frmCourseSearch.OfferID; frmCourseEnrollment.cdsRegistrationDet.Post; end else ShowMessage('You cancelled the search'); end; Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.