2012-11-05 62 views
1

我已經在數據窗口上放置了一個搜索按鈕,並且我已經有一個用於搜索這個列表的事件......一旦按鈕在運行時被點擊,怎麼可能調用一個事件。下面在數據窗口的按鈕上調用一個事件

是我的事件中的代碼爲 「ue_key」

string xcode, iseries, ycode, sql_statement, xname, i_cname, name, iseries_no, irequested_by, irequest_problem, irequesting_dept, idate_request, idate_needed 
    string iasset_no, idate_received, istatus 
    long i_row 
    //integer 

    i_cname = dw_work_order.getcolumnname() 
    i_row = this.getrow() 
    if i_row > 0 then 
     if key = keyF2! and i_cname = 'series_no' then 

      //open(w_csearch) 
      // Then, define select statement 
      sql_statement = "SELECT series_no as 'Series NO', requested_by as 'Requested By' FROM work_order_form where status = 'A' or status = 'ACTIVE';" 

      str_sellist args 
      args.trans = sqlca 
      args.sel_cmd = sql_statement 

      // Specify which column will be the return value 
      args.retcol = 1 

      // Define drop-down items. NOTE: This should correspond 
      // with the alias you use for the columns you retrieve 
      args.dropdown_items[1] = "Series NO" 
      args.dropdown_items[2] = "Requested By" 

      // Define Search Window Title 
      args.title = "Work Order" 

      // Define transaction object for the window 
      // This is REQUIRE for now... :) 


     // Open with parameter 
      OpenWithParm(w_sellist, args) 
      ycode=message.stringparm 

      xcode = ycode 
     // MessageBox('test', xcode) 
      if trim(xcode) <> '' then 

        select series_no, requested_by, request_problem, requesting_dept, date_request,date_needed, asset_no, status          
        into  :iseries, :irequested_by, :irequest_problem, :irequesting_dept, :idate_request, :idate_needed, :iasset_no, :istatus 
        From work_order_form where series_no = :xcode using sqlca; 


    // Messagebox('test', iseries) 
      this.setitem(THIS.GETROW(),'series_no', iseries) 
      this.setitem(THIS.GETROW(),'requested_by', irequested_by) 
      this.setitem(THIS.GETROW(),'request_problem', irequest_problem) 
      this.setitem(THIS.GETROW(),'requesting_dept', irequesting_dept) 
      this.setitem(THIS.GETROW(),'date_request', idate_request) 
      this.setitem(THIS.GETROW(),'date_needed', idate_needed) 
      this.setitem(THIS.GETROW(),'asset_no', iasset_no) 
      this.setitem(THIS.GETROW(),'status', istatus) 

    //dw_work_order.retrieve(iseries) 

      end if 
     end if 
    end if 

非常感謝!

回答

1

數據窗口控件具有「ButtonClicking」和「ButtonClicked」事件。您可以使用這些事件來確定哪個按鈕被點擊(檢查事件參數,特別是dwo.Name)並調用相應的代碼。

您需要確保您的數據窗口按鈕的操作設置爲「用戶定義的(0)」。

相關問題