Hi,
I’m a developer and I created my own framework - for my company, not really mine although I’ve written it
- but can’t use it for this private project I have right now. I have a little trick I used for my autofill suggest combo that I want to pull here but I have no idea if its possible. This is the situation:
I have a select box ,lets say with id ‘searchby’ with values <column name><column title> from a table. The second combobox (or ajaxcombo as I call it) has a datasource server ASP file that has a query like this “select a,b,c from tablename where " + searchby.value + " like ('%” + combobox.value + “%')”.
What did I achieve by this - I can have a select box that would dynamically change its default search column depending on a another form item, or a session variable or a cookie value or combination of those.
Pre-parsing queries in the datasource (so I could replace some of my own notations with real values from the form directly into a Transact-SQL statement) is something i’m trying to achieve with this framework but I just can’t.
I have no clue how to see what parameters are being posted to comboboxes dataURL page and use them while building a query since it seems its all handled by a mind of its own. So what I really need to know is how to get the params and param vales sent to my custom ASP page when submiting a form through httprequest or get the params of current values in certian fields like this combobox.
This is how I started in sc framework:
isc.DynamicForm.create({
ID:"myform",
fields:[{ type:"header", defaultValue:"Search authors"},
{name:"who", title:"Search by", type:"select",
valueMap:{
"au_id":"Authors ID",
"au_lname":"Last name",
"au_fname":"First name",
"city":"City"
}
},
{name:"authors", editorType:"comboBox", optionDataSource:"msDS",title:"Choose author",
valueField:"au_id",
displayField:"au_lname",
pickListFields: [
{name:"au_id"},
{name:"au_lname",title:"Surname"} ,
{name:"au_fname",title:"Name"} ,
{name:"city",title:"City"}
],
pickListWidth: "400",
blur: function() {myform.getField('id').setValue(this.getValue())}
},
{name:"id", editorType:"TextItem", title:"<nobr>Author ID</nobr>"
}
],
position: "relative",
top:"15"
});
isc.DataSource.create({
ID:"msDS",
fields:[
{name:"au_id",title:"ID",primaryKey: "true"} ,
{name:"au_lname",title:"Surname"} ,
{name:"au_fname",title:"Name"} ,
{name:"city",title:"City"}
],
dataFormat: "json",
dataURL : "engine.asp?rnd=" + rnd + "&searchcolumn=" + myform.getField('who').getValue() + "&val=" + myform.getField("authors").getValue()
});
Can anyone help me achieve this?
TIA Peca