Home
TeamSite
Object doesn't support this property or method
lazybee26
Env - 6.5 on solaris.
I'm using a callout to get values from database and write them into some hidden fields in the DCT.
The callout is basically used to display geographic locations for a certain region. Region is a like a continenet and geographic locations are like all countries/states/cities within the region.
The multi select box shows all countries,states and cities within a region, depending on the region selected by user.
Default region "Africa/Middle East", is selected automatically,when creating a new dcr.
Attached
1. Html returned by the callout
2. DCT
3. word doc - Error I get on save and image of how the callout output looks.
Case 1
a. I click on the callout. All destinations for default a default region (Africa/Middle East) are shown in the multi select window.
b. I select a bunch of values from the multiselect dropdown and click OK link on callout.
c. Values get written into the hidden items of DCT, successfully
d. I save the dcr
Case 1 works totally fine. It saves the values in the hidden items etc.
-----------------
Case 2 - PROBLEM
-------------------
a. Same as Case 1
b. The only different thing I do this time, is that, I change the region by clicking on one of the links shown in the callout. All links are creating the problem. Even if i click on "Africa/middle East"
c. So after I select a different region, the javascript changes all values in the multi select for the region selected.
d. I choose a bunch of values and click ok.
e. Values get written into the hidden items of DCT, successfully (Checked by keeping the items visible while debugging)
f. I save the dcr. Well - Here's the problem. After entering the new filename for the DCR, when I click "OK", I get an error (see word doc), that says "Object doesn't support this property or method"
So I guess Im loosing some kind of information, when I click on a link, on the callout. But I'm not sure what, because I'm able to write back the values in both the cases
Any tips / help would be good.
NOTE - pls ignore duplicate values in the multiselect.
Thanks
Find more posts tagged with
Comments
mindy1
Hi,
Did you try looking into the iw-webd logs or local/logs about details of the error.
It will help if you can attach the logs also.
Migrateduser
This is clearly a javascript -- i.e. client side -- error. Client side errors are not logged.
Current Environments:
(1,2) TS 6.5 on W2K3
(3) Vignette V7 Portal on Solaris 9
Migrateduser
What stands out to me is that in function areaobj and regionobj, you're using "this". I'm wondering if your naming convention is colliding with Javascript's own reserved words. In this case, "this" will typically refer to the current document or object. So, I think the typing might be off.
What if you were to declare what your object is in the first line of these functions, set your values, and then return the object?
Dave
Current Environments:
(1,2) TS 6.5 on W2K3
(3) Vignette V7 Portal on Solaris 9
lazybee26
Hi -
Changed my code to assign values in a different style. Not using "this" anymore. I still get the same error as before though.
<html>
<head>
<SCRIPT LANGUAGE="JavaScript">
var region_selected="";
var scriptFrame = "";
var hidden_container = "";
var elem_item = "";
var reg_sel = "";
var M= new Array (
{name:"Africa / Middle East",id:"7",o: new Array(
{country:"Africa",country_id:"43" ,state:"",state_id:"" ,city:"",city_id:"" }
,
{country:"Africa",country_id:"43" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Batswana",country_id:"48" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Batswana",country_id:"48" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Botswana",country_id:"44" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Botswana",country_id:"44" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Egypt",country_id:"36" ,state:"",state_id:"" ,city:"Cairo",city_id:"47" },
{country:"Egypt",country_id:"36" ,state:"",state_id:"" ,city:"Luxor",city_id:"48" },
{country:"Egypt",country_id:"36" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Israel",country_id:"35" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Israel",country_id:"35" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Kenya",country_id:"37" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Kenya",country_id:"37" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Morocco",country_id:"42" ,state:"",state_id:"" ,city:"Fes",city_id:"49" },
{country:"Morocco",country_id:"42" ,state:"",state_id:"" ,city:"Marrakech",city_id:"50" },
{country:"Morocco",country_id:"42" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"South Africa",country_id:"45" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"South Africa",country_id:"45" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Tanzania",country_id:"46" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Tanzania",country_id:"46" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Zimbabwe",country_id:"47" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Zimbabwe",country_id:"47" ,state:"",state_id:"" ,city:"",city_id:"" })//endof region array
}
,{name:"Asia",id:"5",o: new Array(
{country:"Antigua",country_id:"531" ,state:"",state_id:"" ,city:"",city_id:"" }
,
{country:"Antigua",country_id:"531" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Argetina",country_id:"564" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Argetina",country_id:"564" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Bali",country_id:"357" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Bali",country_id:"357" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Barbados",country_id:"535" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Barbados",country_id:"535" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Brazil",country_id:"567" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Brazil",country_id:"567" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Cambodia",country_id:"336" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Cambodia",country_id:"336" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Chile",country_id:"568" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Chile",country_id:"568" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"China",country_id:"38" ,state:"",state_id:"" ,city:"Beijing",city_id:"51" },
{country:"China",country_id:"38" ,state:"",state_id:"" ,city:"Hong Kong",city_id:"52" },
{country:"China",country_id:"38" ,state:"",state_id:"" ,city:"Shanghai",city_id:"53" },
{country:"China",country_id:"38" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"England",country_id:"592" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"England",country_id:"592" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Finland",country_id:"604" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Finland",country_id:"604" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"French Polynesia",country_id:"492" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"French Polynesia",country_id:"492" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Guatemala",country_id:"569" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Guatemala",country_id:"569" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"India",country_id:"4" ,state:"AndhraPradesh",state_id:"4" ,city:"Hyderabad",city_id:"2" },
{country:"India",country_id:"4" ,state:"",state_id:"" ,city:"Hyderabad",city_id:"2" },
{country:"Jamaica",country_id:"540" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Jamaica",country_id:"540" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Japan",country_id:"39" ,state:"",state_id:"" ,city:"Tokyo",city_id:"54" },
{country:"Japan",country_id:"39" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Jordan",country_id:"719" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Jordan",country_id:"719" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Malaysia",country_id:"367" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Malaysia",country_id:"367" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Monaco",country_id:"671" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Monaco",country_id:"671" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Myanmar",country_id:"368" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Myanmar",country_id:"368" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Nevins",country_id:"545" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Nevins",country_id:"545" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"New Zealand",country_id:"497" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"New Zealand",country_id:"497" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Peru",country_id:"571" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Peru",country_id:"571" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Philippines",country_id:"369" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Philippines",country_id:"369" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Poland",country_id:"673" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Poland",country_id:"673" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Puerto Rico",country_id:"548" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Puerto Rico",country_id:"548" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"South Korea",country_id:"465" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"South Korea",country_id:"465" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"St. Barts",country_id:"549" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"St. Barts",country_id:"549" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"St. John",country_id:"553" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"St. John",country_id:"553" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"St. Lucia",country_id:"554" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"St. Lucia",country_id:"554" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"St. Vincent and the Grenadines",country_id:"557" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"St. Vincent and the Grenadines",country_id:"557" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Taiwan",country_id:"466" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Taiwan",country_id:"466" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Thailand",country_id:"371" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Thailand",country_id:"371" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Tortoa",country_id:"547" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Tortoa",country_id:"547" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Turkey",country_id:"694" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Turkey",country_id:"694" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Turks and Caicos",country_id:"558" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Turks and Caicos",country_id:"558" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Vietnam",country_id:"477" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Vietnam",country_id:"477" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Virgin Gorda",country_id:"562" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Virgin Gorda",country_id:"562" ,state:"",state_id:"" ,city:"",city_id:"" })//endof region array
}
,{name:"Australia / Pacific",id:"6",o: new Array(
{country:"Australia",country_id:"33" ,state:"",state_id:"" ,city:"Melbourne",city_id:"61" }
,
{country:"Australia",country_id:"33" ,state:"",state_id:"" ,city:"Sydney",city_id:"62" },
{country:"Australia",country_id:"33" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Fiji",country_id:"34" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Fiji",country_id:"34" ,state:"",state_id:"" ,city:"",city_id:"" })//endof region array
}
,{name:"Carribean",id:"3",o: new Array(
{country:"Anguilla",country_id:"10" ,state:"",state_id:"" ,city:"",city_id:"" }
,
{country:"Anguilla",country_id:"10" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Bahamas",country_id:"40" ,state:"",state_id:"" ,city:"Bahamas",city_id:"55" },
{country:"Bahamas",country_id:"40" ,state:"",state_id:"" ,city:"Harbour Island",city_id:"56" },
{country:"Bahamas",country_id:"40" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Bermuda",country_id:"41" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Bermuda",country_id:"41" ,state:"",state_id:"" ,city:"",city_id:"" })//endof region array
}
,{name:"Europe",id:"4",o: new Array(
{country:"Austria",country_id:"8" ,state:"",state_id:"" ,city:"Salzburg",city_id:"6" }
,
{country:"Austria",country_id:"8" ,state:"",state_id:"" ,city:"Vienna",city_id:"5" },
{country:"Austria",country_id:"8" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Belgium",country_id:"9" ,state:"",state_id:"" ,city:"Brussels",city_id:"7" },
{country:"Belgium",country_id:"9" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Croatia",country_id:"16" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Croatia",country_id:"16" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Czech Republic",country_id:"7" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Czech Republic",country_id:"7" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Denmark",country_id:"14" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Denmark",country_id:"14" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"England",country_id:"11" ,state:"",state_id:"" ,city:"Bath",city_id:"10" },
{country:"England",country_id:"11" ,state:"",state_id:"" ,city:"Devon & Cornwall",city_id:"11" },
{country:"England",country_id:"11" ,state:"",state_id:"" ,city:"Lake District",city_id:"12" },
{country:"England",country_id:"11" ,state:"",state_id:"" ,city:"London",city_id:"13" },
{country:"England",country_id:"11" ,state:"",state_id:"" ,city:"Norfolk",city_id:"14" },
{country:"England",country_id:"11" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Estonia",country_id:"17" ,state:"",state_id:"" ,city:"Tallinn",city_id:"15" },
{country:"Estonia",country_id:"17" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"France",country_id:"2" ,state:"Provence",state_id:"3" ,city:"",city_id:"" },
{country:"France",country_id:"2" ,state:"",state_id:"" ,city:"Avignon",city_id:"16" },
{country:"France",country_id:"2" ,state:"",state_id:"" ,city:"Bordeaux ",city_id:"17" },
{country:"France",country_id:"2" ,state:"",state_id:"" ,city:"Chamonix",city_id:"18" },
{country:"France",country_id:"2" ,state:"",state_id:"" ,city:"La Loire",city_id:"19" },
{country:"France",country_id:"2" ,state:"",state_id:"" ,city:"Marseille",city_id:"20" },
{country:"France",country_id:"2" ,state:"",state_id:"" ,city:"Megeve",city_id:"21" },
{country:"France",country_id:"2" ,state:"",state_id:"" ,city:"Paris",city_id:"4" },
{country:"Germany",country_id:"18" ,state:"",state_id:"" ,city:"Berlin",city_id:"22" },
{country:"Germany",country_id:"18" ,state:"",state_id:"" ,city:"Dresden",city_id:"23" },
{country:"Germany",country_id:"18" ,state:"",state_id:"" ,city:"Hamburg",city_id:"24" },
{country:"Germany",country_id:"18" ,state:"",state_id:"" ,city:"Munich",city_id:"26" },
{country:"Germany",country_id:"18" ,state:"",state_id:"" ,city:"Weimar",city_id:"25" },
{country:"Germany",country_id:"18" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Greece",country_id:"15" ,state:"",state_id:"" ,city:"Athens",city_id:"27" },
{country:"Greece",country_id:"15" ,state:"",state_id:"" ,city:"Cyclades ",city_id:"28" },
{country:"Greece",country_id:"15" ,state:"",state_id:"" ,city:"Peloponnese",city_id:"29" },
{country:"Greece",country_id:"15" ,state:"",state_id:"" ,city:"Rhodes",city_id:"30" },
{country:"Greece",country_id:"15" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Hungary",country_id:"20" ,state:"",state_id:"" ,city:"Budapest",city_id:"31" },
{country:"Hungary",country_id:"20" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Ireland",country_id:"19" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Ireland",country_id:"19" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Italy",country_id:"13" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Italy",country_id:"13" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Netherlands",country_id:"29" ,state:"",state_id:"" ,city:"Amsterdam",city_id:"32" },
{country:"Netherlands",country_id:"29" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Norway",country_id:"21" ,state:"",state_id:"" ,city:"Oslo",city_id:"33" },
{country:"Norway",country_id:"21" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Portugal",country_id:"23" ,state:"",state_id:"" ,city:"Lisbon",city_id:"34" },
{country:"Portugal",country_id:"23" ,state:"",state_id:"" ,city:"Madeira",city_id:"35" },
{country:"Portugal",country_id:"23" ,state:"",state_id:"" ,city:"Porto",city_id:"36" },
{country:"Portugal",country_id:"23" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Russia",country_id:"24" ,state:"",state_id:"" ,city:"Moscow",city_id:"37" },
{country:"Russia",country_id:"24" ,state:"",state_id:"" ,city:"St. Petersburg",city_id:"38" },
{country:"Russia",country_id:"24" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Scotland",country_id:"25" ,state:"",state_id:"" ,city:"Edinburgh",city_id:"39" },
{country:"Scotland",country_id:"25" ,state:"",state_id:"" ,city:"Glasgow",city_id:"40" },
{country:"Scotland",country_id:"25" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Spain",country_id:"26" ,state:"",state_id:"" ,city:"Barcelona",city_id:"41" },
{country:"Spain",country_id:"26" ,state:"",state_id:"" ,city:"Granada",city_id:"42" },
{country:"Spain",country_id:"26" ,state:"",state_id:"" ,city:"Madrid ",city_id:"43" },
{country:"Spain",country_id:"26" ,state:"",state_id:"" ,city:"Seville ",city_id:"44" },
{country:"Spain",country_id:"26" ,state:"",state_id:"" ,city:"Toledo",city_id:"45" },
{country:"Spain",country_id:"26" ,state:"",state_id:"" ,city:"Valencia",city_id:"46" },
{country:"Spain",country_id:"26" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Sweden",country_id:"27" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Sweden",country_id:"27" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Switzerland",country_id:"28" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Switzerland",country_id:"28" ,state:"",state_id:"" ,city:"",city_id:"" })//endof region array
}
,{name:"Latin America",id:"2",o: new Array(
{country:"Argentina",country_id:"32" ,state:"",state_id:"" ,city:"Buenos Aires",city_id:"60" }
,
{country:"Argentina",country_id:"32" ,state:"",state_id:"" ,city:"",city_id:"" },
{country:"Mexico",country_id:"3" ,state:"Sonora",state_id:"5" ,city:"",city_id:"" },
{country:"Mexico",country_id:"3" ,state:"",state_id:"" ,city:"Cancun",city_id:"57" },
{country:"Mexico",country_id:"3" ,state:"",state_id:"" ,city:"Cozumel",city_id:"58" },
{country:"Mexico",country_id:"3" ,state:"",state_id:"" ,city:"Mexico City",city_id:"59" })//endof region array
}
,{name:"USA & Canada",id:"1",o: new Array(
{country:"Canada",country_id:"1" ,state:"Ontario",state_id:"2" ,city:"",city_id:"" }
,
{country:"Canada",country_id:"1" ,state:"Quebec",state_id:"1" ,city:"",city_id:"" },
{country:"Canada",country_id:"1" ,state:"",state_id:"" ,city:"Montreal",city_id:"1" },
{country:"Canada",country_id:"1" ,state:"",state_id:"" ,city:"Toronto",city_id:"3" },
{country:"USA",country_id:"5" ,state:"Arizona",state_id:"8" ,city:"",city_id:"" },
{country:"USA",country_id:"5" ,state:"California",state_id:"7" ,city:"San Diego",city_id:"9" },
{country:"USA",country_id:"5" ,state:"Colorado",state_id:"9" ,city:"",city_id:"" },
{country:"USA",country_id:"5" ,state:"Connecticut",state_id:"10" ,city:"",city_id:"" },
{country:"USA",country_id:"5" ,state:"Delaware",state_id:"11" ,city:"",city_id:"" },
{country:"USA",country_id:"5" ,state:"Florida",state_id:"6" ,city:"Orlando",city_id:"8" },
{country:"USA",country_id:"5" ,state:"Georgia",state_id:"12" ,city:"",city_id:"" },
{country:"USA",country_id:"5" ,state:"Hawaii",state_id:"13" ,city:"",city_id:"" },
{country:"USA",country_id:"5" ,state:"Illinois",state_id:"14" ,city:"",city_id:"" },
{country:"USA",country_id:"5" ,state:"Louisiana",state_id:"15" ,city:"",city_id:"" },
{country:"USA",country_id:"5" ,state:"Maine",state_id:"16" ,city:"",city_id:"" },
{country:"USA",country_id:"5" ,state:"Maryland",state_id:"17" ,city:"",city_id:"" },
{country:"USA",country_id:"5" ,state:"Massachusetts",state_id:"18" ,city:"",city_id:"" },
{country:"USA",country_id:"5" ,state:"Michigan",state_id:"19" ,city:"",city_id:"" },
{country:"USA",country_id:"5" ,state:"Minnesota",state_id:"20" ,city:"",city_id:"" },
{country:"USA",country_id:"5" ,state:"Mississippi",state_id:"21" ,city:"",city_id:"" },
{country:"USA",country_id:"5" ,state:"Nevada",state_id:"22" ,city:"",city_id:"" },
{country:"USA",country_id:"5" ,state:"New Mexico",state_id:"23" ,city:"",city_id:"" },
{country:"USA",country_id:"5" ,state:"New York",state_id:"24" ,city:"",city_id:"" },
{country:"USA",country_id:"5" ,state:"North Carolina",state_id:"25" ,city:"",city_id:"" },
{country:"USA",country_id:"5" ,state:"Ohio",state_id:"26" ,city:"",city_id:"" },
{country:"USA",country_id:"5" ,state:"Oregon",state_id:"27" ,city:"",city_id:"" },
{country:"USA",country_id:"5" ,state:"Pennsylvania",state_id:"28" ,city:"",city_id:"" },
{country:"USA",country_id:"5" ,state:"Rhode Island",state_id:"29" ,city:"",city_id:"" },
{country:"USA",country_id:"5" ,state:"South Carolina",state_id:"30" ,city:"",city_id:"" },
{country:"USA",country_id:"5" ,state:"Tennessee",state_id:"31" ,city:"",city_id:"" },
{country:"USA",country_id:"5" ,state:"Texas",state_id:"32" ,city:"",city_id:"" },
{country:"USA",country_id:"5" ,state:"Utah",state_id:"33" ,city:"",city_id:"" },
{country:"USA",country_id:"5" ,state:"Vermont",state_id:"34" ,city:"",city_id:"" },
{country:"USA",country_id:"5" ,state:"Virginia",state_id:"35" ,city:"",city_id:"" },
{country:"USA",country_id:"5" ,state:"Washington",state_id:"36" ,city:"",city_id:"" },
{country:"USA",country_id:"5" ,state:"Washington D.C.",state_id:"37" ,city:"",city_id:"" },
{country:"USA",country_id:"5" ,state:"West Virginia",state_id:"38" ,city:"",city_id:"" },
{country:"USA",country_id:"5" ,state:"Wisconsin",state_id:"39" ,city:"",city_id:"" },
{country:"USA",country_id:"5" ,state:"Wyoming",state_id:"40" ,city:"",city_id:"" },
{country:"USA",country_id:"5" ,state:"",state_id:"" ,city:"Orlando",city_id:"8" },
{country:"USA",country_id:"5" ,state:"",state_id:"" ,city:"San Diego",city_id:"9" })});
// itemArray = reference to an array
// select = option item to populate
function fill_all_country_states_cities(select, item_id)
{
item_id= (item_id==null || item_id=="")?7: item_id;
region_selected=item_id; // save region id in global
var i=0, j=0;
var region_obj;
var regdetail_arr=null;
//get the child object of region
if (item_id != null) {
for (i=0; i<M.length ; i++){
if(M
.id==item_id){
regdetail_arr=M
.o;
}
}
}
else{
return;
}
// First clean and then add all items from this region
if(regdetail_arr !=null)
{
clean(select);
for (l=0; l<regdetail_arr.length; l++){
var csc_name="";
var csc_id="";
if(regdetail_arr.country !=""){
csc_name = csc_name != ""? csc_name + "::" + regdetail_arr.country : regdetail_arr.country;
csc_id = csc_id != "" ? csc_id + "::" + "country::"+regdetail_arr.country_id : "country::"+regdetail_arr.country_id;
}
if(regdetail_arr.state !=""){
csc_name = csc_name != ""? csc_name + ">>" + regdetail_arr.state : regdetail_arr.state;
csc_id = csc_id != "" ? csc_id + "::" + "state::"+regdetail_arr.state_id : "state::"+regdetail_arr.state_id;
}
if(regdetail_arr.city !=""){
csc_name = csc_name != ""? csc_name + ">>" + regdetail_arr.city : regdetail_arr.city;
csc_id = csc_id != "" ? csc_id + "::" + "city::"+regdetail_arr.city_id : "city::"+regdetail_arr.city_id;
}
select.options = new Option(csc_name, csc_id);
var re = new RegExp(csc_name + ";");
select.options.selected = elem_item.getValue().match(re)? true : false ;
j++;
}// region detail
}//regdetail_arr !=null
}//fill_all_country_states_cities
function clean(select)
{
// empty existing items
for (i = select.options.length; i >= 0; i--)
select.options
= null;
}
function handle_onload()
{
var r=7;
scriptFrame = opener.top.getScriptFrame();
hidden_container= scriptFrame.IWDatacapture.getItem("DealDetailRoot/DealLocationCapturedContainer");
elem_item = scriptFrame.IWDatacapture.getItem("DealDetailRoot/DealLocationContainer/deal_location");
reg_sel =scriptFrame.IWDatacapture.getItem("DealDetailRoot/DealLocationContainer/storereg");
fill_all_country_states_cities(document.country_state_city.csc,r);
}// handle_onload()
function set_datacapture_item_value( optionsArray )
{
if ((window.opener == null) ||
(window.opener.closed))
{
return false;
}
var calloutForm = eval(window.opener.top._dcWin.formframe.document.dcreditForm);
if (!calloutForm)
{
return false;
}
var calloutElementFound = false;
var writevals="";
var replicant_index=1;
reg_sel.setValue(region_selected);
if(elem_item){
// clean the hidden replicant first
clean_replicant(hidden_container);
for(j=0 ; j<optionsArray.length ;j++){
if(optionsArray.selected){
// Perl would interpret it the line feed, hence this approach.
writevals += optionsArray.text + ";" + String.fromCharCode(10);
store_ids(optionsArray, hidden_container, replicant_index++);
}
}
//alert("Writing to " + elem_item.getName());
elem_item.setValue(writevals);
elem_item.setFocus(true);
if(opener.top.datacapture) {
//opener.top.datacapture.refreshItem(elem_item);
opener.top.datacapture.refreshForm();
//scriptFrame.IWDatacapture.setHighlightMode (true) ;
//scriptFrame.IWDatacapture.redrawLabels() ;
//alert("rep count= " + hidden_container.getChildren().length);
}
return true;
}
else
{
return false;
}
}//set_datacapture_item_value
// Ids of country/state/city are saved in a hidden item. Item name is passed in
function store_ids(sopt, hidden_container, replicant_index)
{
var rep_ins=hidden_container.addInstance(replicant_index);
//extract values
var sa=sopt.value.split("::");
for(i=0; sa
!=null; i +=2){
//alert( i +"]-[" + sa
);
if(sa
=="country"){
var dlci_country=rep_ins.getChildByName ("dlci_country");
dlci_country.setValue(sa[i+1]);
}
else if(sa
=="state"){
var dlci_sp=rep_ins.getChildByName ("dlci_state_province");
dlci_sp.setValue(sa[i+1]);
}
else if(sa
=="city"){
var dlci_city=rep_ins.getChildByName ("dlci_city");
dlci_city.setValue(sa[i+1]);
}
}//
}//store_ids
function clean_replicant(rep){
var rep_length=rep.getChildren().length;
//alert(rep_length);
// Its important to delete instances in reverse order !
for (i=rep_length; i>0;i--){
var s =rep.deleteInstance(i);
//alert (s);
}
}
function handle_selection(select){
if (callback(select)) {
self.close();
}
else{
alert('Please make a selection.');
}
}
function callback(select){
var optionsArray = select.options;
for ( i = 0 ; i < optionsArray.length ; i++ )
{
if (optionsArray
.selected)
{
if (!set_datacapture_item_value( optionsArray ))
{
alert('Fatal callout error. Did you close the datacapture window?');
}
return true;
}
}
// did not find a selected option!
return false;
}
</script>
</head>
<body onload=javascript:handle_onload();>
<table>
<form name="country_state_city" action="post" >
<TR>
<TD colSpan="2">
<P><span>Select Destinations  </span>
<span style="color:Red;visibility:hidden;"></span><BR>
<select name="csc" size="5" multiple="multiple" style="width:337px;">
</select>
</td></tr><tr>
<td>
<br<BR><br>
<a href=javascript:fill_all_country_states_cities(document.country_state_city.csc,7);>Africa / Middle East</a>
|
<a href=javascript:fill_all_country_states_cities(document.country_state_city.csc,5);>Asia</a>
|
<a href=javascript:fill_all_country_states_cities(document.country_state_city.csc,6);>Australia / Pacific</a>
|
<a href=javascript:fill_all_country_states_cities(document.country_state_city.csc,3);>Carribean</a>
|
<a href=javascript:fill_all_country_states_cities(document.country_state_city.csc,4);>Europe</a>
|
<a href=javascript:fill_all_country_states_cities(document.country_state_city.csc,2);>Latin America</a>
|
<a href=javascript:fill_all_country_states_cities(document.country_state_city.csc,1);>USA & Canada</a>
|
</SPAN></P>
</TD></TR>
<br><br><br>
<TR><TD>
<a href=javascript:handle_selection(document.country_state_city.csc); >OK</a></TD>
</TR>
</form></table></body></html>
lazybee26
Just found out that - If I comment the line
"reg_sel.setValue(region_selected);" in my code, it works for case 2 also.
The line is one of the writes to a hidden value in the dct.
There's 4 writes in total that i do. And all of them are successful as far as wrting values into the DB.
Any clues?
Migrateduser
Is storereg a hidden field? If so, what happens if you try to alert the value of that field just before the line which you have commented out? Also, please ATTACH your DCT (pasting so much text is horrible for others who read this thread and want to help -- often, it's more convenient for readers if you attach large blocks of text like this). I'm wondering if your path is well-formed.
Dave
Current Environments:
(1,2) TS 6.5 on W2K3
(3) Vignette V7 Portal on Solaris 9