|
// Bu şekilde çağırıyorum ve bana callerform bulunamadı hatası veriyordu.Çözümü en altta callerformu çağırdığın yeri callerformu atadığın yerde uses ile kullanma
// HATALI KOD // --- KAYDETME (POST /items) ---
void OnItemSaved(Sender) var LRest: TCLRest; LParentRefreshBtn : TclButton; { MainForm.FormWaiting.Visible = False; LRest = TCLRest(Sender); if ((LRest.StatusCode == 200) || (LRest.StatusCode == 201)) { ShowMessage('Ürün başarıyla eklendi!'); // Formu Temizle ItemNameEdit.Text = ''; ItemPriceEdit.Text = ''; ItemNameLbl.Text = 'ÜRÜN ADI'; MainForm.SetImage(ItemImage,' https://clomosy.com/learn/clomosy.png" rel="nofollow - https://clomosy.com/learn/clomosy.png '); IsImageChanged = False; // --- ANA SAYFAYI TETİKLEME (REFRESH) --- if (CallerForm <> nil) { // Ana formdaki gizli butonu bul ve tıkla LParentRefreshBtn = TclButton(CallerForm.clFindComponent('RefreshCategoriesBtn')); if (LParentRefreshBtn <> nil) { clDoClick(LParentRefreshBtn); } } //MainForm.Close; // ---------------------------------------- } else { ShowMessage('Hata: ' + Clomosy.CLParseJSON(LRest.Response, 'message')); } }
// yollama şeklim ise
void gotouAddItems { CloseAdminItemsPopUpV; uAddItems.SetCategoryIDV(CategoryId); //Clomosy.RunUnit('uAddItems'); UnitAddItem.UnitName = 'uAddItems'; UnitAddItem.CallerForm = MainForm; UnitAddItem.Run; } // ÇÖZUM // --- ANA SAYFAYI TETİKLEME (REFRESH) --- if (CallerForm <> nil) { ShowMessage('bulundu') // Ana formdaki gizli butonu bul ve tıkla LParentRefreshBtn = TclButton(TCLForm(CallerForm).clFindComponent('Refresh*temsBtn')); if (LParentRefreshBtn <> nil) { clDoClick(LParentRefreshBtn); ShowMessage('LParentRefreshBtn bulundu') } } ShowMessage('bulunamadı') //MainForm.Close; // ---------------------------------------- // FARKLI BIR UNITTE caller formun çağrıldığı yer AYNI // --- ANA SAYFAYI TETİKLEME (REFRESH) --- if (CallerForm <> nil) { ShowMessage('bulundu') // Ana formdaki gizli butonu bul ve tıkla LParentRefreshBtn = TclButton(TCLForm(CallerForm).clFindComponent('Refresh*temsBtn')); if (LParentRefreshBtn <> nil) { clDoClick(LParentRefreshBtn); ShowMessage('LParentRefreshBtn bulundu') } } ShowMessage('bulunamadı') //MainForm.Close; // ---------------------------------------- https://static.cloudflareinsights.com/beacon.min.js/vcd15cbe7772f49c399c6a5babf22c1241717689176015" rel="nofollow - https://static.cloudflareinsights.com/beacon.min.js/vcd15cbe7772f49c399c6a5babf22c1241717689176015" integrity="sha512-ZpsOmlRQV6y907TI0dKBHq9Md29nnaEIPlkf84rnaERnq6zvWvPUqr2ft8M1aS28oN72PdrCzSjY4U6VaAw1EQ==" data-cf-beacon="{"version":"2024.11.0","token":"439455f3e46c40b98dbd42a2f1a954d8","r":1,"server_timing":{"name":{"cfCacheStatus":true,"cfEdge":true,"cfExtPri":true,"cfL4":true,"cfOrigin":true,"cfSpeedBrain":true},"location_startswith":null}}" crossorigin="anonymous">
|