Greetings,
We're using version 8 pro. This is the GA version, not a nightly build. I've got a really strange problem that has been around for a while and I can't figure out what the problem is. I have isolated it to the isomorphic code, meaning that it's most definitely not the data coming back from the datasource.
I'm using the combobox for a typeahead search. As you type a company name, a list of companies drops down. It works great, except in a couple of instances where clicking on a record gives me a different company, the one above it. Every single time. And only when these two companies are listed together.
Below is a snapshot of the RPC trace, you can see the data. When I click on the first company_code:"800626", item.getSelectedRecord() gives me the record I selected. When I click on the last company, company_code:"20699", I get the correct record back. But when I click on the second company, company_code:"300626", I don't get that company I get the first company 800626. This happens no matter how many companies I have. The list can be 40 rows and it still happens, and only on these two records - 300626 and 800626 get confused. There are a few other searches where it happens with certain companies, but it's very esoteric. It only happens with a few companies and only when they are listed together.
In test case is below I limited the resultset on the server side to just three companies to isolate the problem. In the item changed section you can see where I get the record, var company = item.getSelectedRecord().script; and then just below that you can see the alert. That alert shows me the data for the first company when the second one was clicked on. I've also put a breakpoint using IE's javascript debugger and looked at the object returned by getSelectedRecord(). And it's in fact the wrong object. The one returned is for the first company, not the one I selected.
I've been very careful with the testing, and this is repeatable every time. Do you have any idea why this would happen?
S
We're using version 8 pro. This is the GA version, not a nightly build. I've got a really strange problem that has been around for a while and I can't figure out what the problem is. I have isolated it to the isomorphic code, meaning that it's most definitely not the data coming back from the datasource.
I'm using the combobox for a typeahead search. As you type a company name, a list of companies drops down. It works great, except in a couple of instances where clicking on a record gives me a different company, the one above it. Every single time. And only when these two companies are listed together.
Below is a snapshot of the RPC trace, you can see the data. When I click on the first company_code:"800626", item.getSelectedRecord() gives me the record I selected. When I click on the last company, company_code:"20699", I get the correct record back. But when I click on the second company, company_code:"300626", I don't get that company I get the first company 800626. This happens no matter how many companies I have. The list can be 40 rows and it still happens, and only on these two records - 300626 and 800626 get confused. There are a few other searches where it happens with certain companies, but it's very esoteric. It only happens with a few companies and only when they are listed together.
In test case is below I limited the resultset on the server side to just three companies to isolate the problem. In the item changed section you can see where I get the record, var company = item.getSelectedRecord().script; and then just below that you can see the alert. That alert shows me the data for the first company when the second one was clicked on. I've also put a breakpoint using IE's javascript debugger and looked at the object returned by getSelectedRecord(). And it's in fact the wrong object. The one returned is for the first company, not the one I selected.
I've been very careful with the testing, and this is repeatable every time. Do you have any idea why this would happen?
S
Code:
isc.DynamicForm.create({ fields:[ {prompt:"Search for companies by entering a ticker symbol, full or partial company name, NAIC code, or group name.", hint:"Enter ticker, name, NAIC code or group", showHintInField:true, name:"qsSearchField", ID:"searchField", showPickerIcon:false, showFocused:true, selectOnFocus:true, optionDataSource: "GlobalQuickSearchDataSource", editorType: "comboBox", showTitle:false, width:420, pickListHeaderHeight:1, pickListFields: [ {name: 'company_code_dis', showTitle:false, width:48}, {name: 'stmt', showTitle:false, width:38}, {name: 'company_name', ID:'company_name', showTitle:false, width:260}, {name: 'ticker', showTitle:false, width:50}, {name: 'company_code_dis', showIf:"false"}, {name: 'ins_type', showIf:"false"}, {name: 'script', showIf:"false"}, {name: 'subscribed', showIf:"false"} ], getPickListFilterCriteria : function () { var value = this.getDisplayValue(); if (value == '') { value=' '; } return {value:value}; } }//, //{startRow:false, disabled:true, name:"findbtn", editorType:"button", width:100, title:"Find", click:"layoutViewController('quickSearch');quickSearch(quickSearchForm.getValue('qsSearchField'))"} ], itemChanged: function (item, newValue) { var showAll = false; try { var resultString = "Show all results for"; var strIndex = newValue.indexOf(resultString); if (strIndex > -1) { layoutViewController('quickSearch'); quickSearch(newValue.substr(resultString.length+1)); searchTerm = newValue.substr(resultString.length+1); showAll = true; } } catch (err) { //alert("D100 An exception occurred. " + " Error name: " + err.name + ". Error message: " + err.message); } try { if (!showAll) { var company = item.getSelectedRecord().script; var hrefLink = 'javascript:'; var jsString = company.substr(hrefLink.length); alert(company); //eval(jsString); document.location.href=company; } }catch (err) {} }, ID:"quickSearchForm", autoDraw:false })
Code:
[ { queueStatus:0, invalidateCache:false, data:[ { ticker:"", stmt:"", company_code_dis:"", company_name:"Show all results for ace" }, { ins_type:"8", script:"/iap/ng/jsp/companyIntelligence/viewCompanyIntel.jsp?it=8&cc=E0626", stmt:"ENT", company_code:"800626", company_code_dis:"E0626", company_name:"ACE Ltd Group*" }, { ins_type:"1", script:"/iap/ng/jsp/companyIntelligence/viewCompanyIntel.jsp?it=1&cc=P0626", stmt:"P&C", company_code:"300626", company_code_dis:"P0626", company_name:"ACE Ltd Group*" }, { ins_type:"1", script:"/iap/ng/jsp/companyIntelligence/viewCompanyIntel.jsp?it=1&cc=20699", stmt:"P&C", company_code:"20699", company_code_dis:"20699", company_name:"Ace Prop & Cas Ins Co" } ], status:0, totalRows:4, isDSResponse:true } ]
Comment