Sayfayı Yazdır | Pencereyi Kapat

CallerForm is not declared Hatası

Nereden Yazdırıldığı: Clomosy | Forum
Kategori: Genel Programlama
Forum Adı: Clomosy ile değişken kullanımı
Forum Tanımlaması: TRObject dili ile değişken tanımlaması ve ekranda gösterme
URL: https://forum.clomosy.com.tr/forum_posts.asp?TID=1245
Tarih: 17 Aralık 2025 Saat 21:59
Program Versiyonu: Web Wiz Forums 12.07 - https://www.webwizforums.com


Konu: CallerForm is not declared Hatası
Mesajı Yazan: M-Guney
Konu: CallerForm is not declared Hatası
Mesaj Tarihi: 17 Aralık 2025 Saat 18:18
// 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">



Sayfayı Yazdır | Pencereyi Kapat

Forum Software by Web Wiz Forums® version 12.07 - https://www.webwizforums.com
Copyright ©2001-2024 Web Wiz Ltd. - https://www.webwiz.net