Hallo zusammen,
hab dem letzt schon mal das Problem mit den Combboxen gepostet. Dieses Problem ist teilweise gelöst. Ich fülle vier Combos mit unterschiedliche Atrributen aus einem xml. diese werden auch in den comboboxen angezeigt, bloß nicht vollstädig es fehlt die hälfte der werte aus dem xml array. woran kann das liegen?
PHP-Code:
onLoad = function() {
_root.requestObjects("http://localhost/campus/campus.php");
}
stop();
this.myObjectXML = new XML();
this.myObjectXML.ignoreWhite = true;
this.myObjectXML.onLoad = function(sucess) { importbuilding(sucess); }
var building = new Array();
var fak_name = new Array();
var room = new Array();
var per_name = new Array();
building.push("Wählen Sie");
fak_name.push("Wählen Sie");
room.push("Wählen Sie");
per_name.push("Wählen Sie");
function importbuilding(sucess) {
if(sucess) {
var xml_target = this.myObjectXML.firstChild;
if (xml_target.nodeName == "campus")
{
for(var i=0; i<xml_target.childNodes.length; i++)
{
if (xml_target.childNodes[i].nodeName == "bau")
{
building.push(xml_target.childNodes[i].attributes.building_name);
}
if(xml_target.childNodes[i].nodeName = "fak")
{
fak_name.push(xml_target.childNodes[i].attributes.course);
}
if(xml_target.childNodes[i].nodeName = "rau")
{
room.push(xml_target.childNodes[i].attributes.rooms_id);
}
if(xml_target.childNodes[i].nodeName = "per")
{
per_name.push(xml_target.childNodes[i].attributes.surname);
}
}
}
delete(this.myObjectXML);
coBoData(building, fak_name, room, per_name);
}
}
function requestObjects(MyRequestURL) {
this.myObjectXML.load(MyRequestURL);
}
function coBoData(dataArray) {
cb_bau.clear;
cb_bau.dataProvider = building;
cb_bau.setStyle("openDuration", 600);
cb_bau.setStyle("openEasing");
cb_bau.setStyle("themeColor", "haloOrange");
cb_fak.clear;
cb_fak.dataProvider = fak_name;
cb_fak.setStyle("openDuration", 500);
cb_fak.setStyle("openEasing");
cb_fak.setStyle("themeColor", "haloOrange");
cb_fak.setStyleProperty("embedFonts", 1);
cb_rau.clear;
cb_rau.dataProvider = room;
cb_rau.setStyle("openDuration", 500);
cb_rau.setStyle("openEasing");
cb_rau.setStyle("themeColor", "haloOrange");
cb_per.clear;
cb_per.dataProvider = per_name;
cb_per.setStyle("openDuration", 500);
cb_per.setStyle("openEasing");
cb_per.setStyle("themeColor", "haloOrange");
}
hier noch das xml:
PHP-Code:
<bau building_id="P" building_name="P-Bau"
description="Vorlesungsraeume,Bueros,Sekretariat" number_storeys="6" picture=""></bau>
<bau building_id="BIB" building_name="PH-Bau" description="Bibliothek" number_storeys="2" picture=""></bau>
<bau building_id="R" building_name="R-Bau" description="Rektorat" number_storeys="3" picture=""></bau>
<fak department_id="3" name_department="Architektur und Bauwesen" course="Bauingenieur trinational (B, M)" storey_id="2" building_id="B"></fak>
<fak department_id="5" name_department="Architektur und Bauwesen" course="Baumanagement und Baubetrieb (B)" storey_id="4" building_id="B"></fak>
<fak department_id="1" name_department="Architektur und Bauwesen" course="Architektur (B,M)" storey_id="1" building_id="D"></fak>
<per person_id="32" titel="Prof." surname="Aberle" forename="Marcus" function="Hauptamtlicher Professor (AB)" phone_number="0721 925-2628" mail="Marcus.Aberle@hs-karlsruhe.de" rooms_id="B 414" info=""></per>
<per person_id="21" titel="Prof." surname="Baumann" forename="Markus" function="Prodekan/ Studiendekan/ Bauingenieurswesen/ Hauptamtlicher Professor (AB)" phone_number="0721 925-2630" mail="Markus.Baumann@hs-Karlsruhe.de" rooms_id="B 308" info=""></per>
<per person_id="15" titel="" surname="Becker" forename="Ruth" function="Mitarbeiterin Sekretariat Vermessung/ Geomatik" phone_number="0721 925-2590" mail="ruth.becker@hs-karlsruhe.de" rooms_id="B 216" info=""></per>
<rau rooms_id="B 051" storey_id="0" description="WC Damen"></rau>
<rau rooms_id="B 052" storey_id="0" description="WC Herren"></rau>
<rau rooms_id="B 054" storey_id="0" description="Behinderten WC"></rau>