Hello All,
Please help me to set Default value for the dynamic Dropdownbox, I am getting the values into the dropdownbox using xbasic, but how to set the Default values as 'Select'.
I am populating the dropdownbox values using sql query but could not able to set Default value. I am
ffunction populateStep2InputTypeVal as c(e as p)
dim js as c
dim cn as sql::connection
dim args as sql::Arguments
dim flag as L
dim sqlCommand as c
dim rs as sql::ResultSet
dim json as c
dim query as c
dim newList as c
flag = cn.open("::Name::hireCon")
if flag == .f. then
js = "alert('Couldn't connect to database.');"
populateStep2InputTypeVal = js
exit function
end if
query = " select distinct INPUT_TYPE from hera_input_types "
query = query + " WHERE brand = '"+SESSION.BRAND+"' "
query = query + " AND modelNumber = '"+SESSION.MODELNO+"' order by INPUT_TYPE"
sqlCommand = query
flag = cn.execute(sqlCommand)
if flag == .f. then
js = "alert('Couldn't execute the query.');"
cn.Close()
populateStep2InputTypeVal = js
exit function
end if
newList = cn.ResultSet.toString()
cn.FreeResult()
cn.Close()
newList=js_list_to_array(newList)
js=<<%txt%
var data = _data_;
var curData = "";
var clearExisting = true;
{dialog.object}.populateDropdownBox('dropdownbox4',data,clearExisting);
%txt%
js=stritran(js,"_data_",newList)
populateStep2InputTypeVal = js
end function
Please help me to set Default value for the dynamic Dropdownbox, I am getting the values into the dropdownbox using xbasic, but how to set the Default values as 'Select'.
I am populating the dropdownbox values using sql query but could not able to set Default value. I am
ffunction populateStep2InputTypeVal as c(e as p)
dim js as c
dim cn as sql::connection
dim args as sql::Arguments
dim flag as L
dim sqlCommand as c
dim rs as sql::ResultSet
dim json as c
dim query as c
dim newList as c
flag = cn.open("::Name::hireCon")
if flag == .f. then
js = "alert('Couldn't connect to database.');"
populateStep2InputTypeVal = js
exit function
end if
query = " select distinct INPUT_TYPE from hera_input_types "
query = query + " WHERE brand = '"+SESSION.BRAND+"' "
query = query + " AND modelNumber = '"+SESSION.MODELNO+"' order by INPUT_TYPE"
sqlCommand = query
flag = cn.execute(sqlCommand)
if flag == .f. then
js = "alert('Couldn't execute the query.');"
cn.Close()
populateStep2InputTypeVal = js
exit function
end if
newList = cn.ResultSet.toString()
cn.FreeResult()
cn.Close()
newList=js_list_to_array(newList)
js=<<%txt%
var data = _data_;
var curData = "";
var clearExisting = true;
{dialog.object}.populateDropdownBox('dropdownbox4',data,clearExisting);
%txt%
js=stritran(js,"_data_",newList)
populateStep2InputTypeVal = js
end function
Comment