comboBox issue

Hi,
I’m a developer and I created my own framework - for my company, not really mine although I’ve written it :frowning: - 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

Overcome in parts

Aham, I got it, by changing the “displayField” param I can change what column will be searched by the typing in the box, but still, I would like to always put a certain colum as the result of selecting an item. Like this, - I want to change search column based on a value in another field but always get the same column after I selected a row. I want to search by “au_id” but always get the “au_lname” when selecting from a picList. And BTW, how do you call the event “when I choose something form a pickList” ?!? I don’t see in the docs that a pickList has onClick or click event defined like the comboBox since a click in the box is not the same as a click in its pickList…
Stil, the question remains, how can I get more control over what fields and values are going between the component and its dataUrl ASP file…

TIA,Peca

I think you’re looking for ComboBoxItem.getPickListFilterCriteria(). Let us know if this doesn’t help
Thanks
Isomorphic Software

Still…

First,genuine thanks for bothering to answer :slight_smile: I’ve seen that but have no idea how to implement it since there are no code examples (read the p.s. section) and btw getSomethingSomething is for getting, not setting a property and I want to set the filter dynamically, not retrive it. I have one selectbox where you pick by what column you want to search the other combobox and by changing the value in the first to dynamically change the search criteria in the second box.

1.Can that be done?

2.What event is triggered when I actually choose something from a pickList in a combo ?

3.How to force a combobox to fetch data from the database every time and not use local filtering?

4.How to force a combobox to wait for lets say 500 msec before going for results (fast typing - why go three time to retrive data when it can go only once)

TIA,
Peca

p.s. Your docs are comprehensive and impressive but there is a very small number of code examples. Your “explorer” is showing just a tiny tiny bit of possibilities and it would be great if you could include more of them to clarify the use of methods (like getPickListFilterCriteria()) etc. Then this forum would be a lot less bothered with noob stuff (90% of questions us noobs are asking).

p.s.s. Keep up the good work :slight_smile:

Hi superpeca,

  1. getPickListFilterCriteria() is an API you override (not call) in order to provide filter criteria on the fly whenever the ComboBox requests data. See this this example.

  2. changed()

  3. are you sure you want to do this? If so, it’s possible via editorProperties : { pickListProperties : { dataProperties : { useLocalFiltering:false } } }

  4. this behavior already exists, the default delay is 200ms.

Thanks!

You’ve been of great help! Thank you for helping me, now I have what to show to my investors and I’m sure they’re going to buy a couple of comercial licences of your framework cause no one else gave me straight answers , for free,like you did!
Yes, I’m sure I want it to fetch data that way cause I will not use standard fetching and allow only top 50 results to go back that meet the criteria in the combobox. A) fast and informative enough in 90% of the cases 2) Scenario: If a worker leaves its computer for a 2 hour lunch brake I don’t want to be the one explaining him that he needs to refresh the page (empty the box etc.) to see what his colleague entered 15 mins ago… And who in his right mind is going to scroll through 20.000 records to find something starting with letter Z ?!? :slight_smile:

Check the eqvivalent to your combo that I wrote on: http://www.encimenci.com/page66.asp
*field Mesto
It fetches data every time and its a list of all the PO boxes in the entire country (thousands) …

Thanks again,
Peca