Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9238

Re: Type Ahead - Against Database / Google Maps

$
0
0

God helps them that help themselves, right?

 

For the database aspect of this, I have created a datawindow for account with columns 'name' and 'account_no' as dw_account_name_like with :name as an argument against the database using the 'like' clause. I also created a dddw with edit style DDDW with 'name' for display and 'account_no' for data.

 

In the open event of my window, I have the following code:

 

dw_1.settransobject(sqlca)

//DataWindowChild dwc_account_name //as global variable

dwc_account_name.settransobject(sqlca)
long rtncode
rtncode = dw_1.GetChild('name', dwc_account_name)
IF rtncode = -1 THEN MessageBox("Error", "Not a DataWindowChild")
dwc_account_name.SetTransObject(SQLCA)

long newrow
newrow = dw_1.insertrow(0)
dw_1.setitem(newrow, "name", "")

 

In the editchanged event of dw_1 I have the following code:

 

string account_name_like
string account

account_name_like = dwc_account_name.getitemstring(1, "name")

account_name_like = '%' + account_name_like + '%'

dwc_account_name.retrieve(account_name_like)

account = data

 

For dw_1 I have defined:

 

- Allow Editing (checked)

- Empty String is Null (checked)

- Required (checked)

- Always Show List (checked)

- Always Show Arrow (checked)

- Vertical Scroll Bar (checked)

- Line in Drop Down = 5

 

For dw_1 (as dw_account_name_like and dddw dddw_account_name, I have both set to tab order 10.

 

When I run the application, I do not see a drop down list. I do not see an arrow. I can type into dw_1 (name column) and I see the cursor change when I type. But it doesn't seem like anything is getting pulled.

 

Thanks in advance for any help!!

 

Paul


Viewing all articles
Browse latest Browse all 9238

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>