Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 12-04-2002, 06:06 AM   #1
bonechair
Registered User
 
bonechair's Avatar
 
Join Date: Dec 2002
Posts: 12
Send a message via Yahoo to bonechair
Cool I need help with listbox

You can see it in action at http://www.martialdesigns.com/rules/
The listbox is not getting cleared correctly.
When you click on www you get
Rulename:www
Rulename:www2
And when clicked on others it does not clear the listbox fully..

Heres some of the code

// function to GET DATA from address book into listbox
// isAdd = true if user has just added a new record
function dataLoad(isAdd) {
var sLabel, i;

lvAddressData.onLoad = function() {
lbxAddressDisplay.removeAll();

combo1.removeAll();
combo1.addItem("Assign To?",11);
for (i=0; i<this.n; i++) {




if (this["thename"+i] == null){
}
else {
combo1.addItem(padr(this["thename"+i]),padr(this["thedata"+i]));
}

if (this["rulename"+i] == null){
}
else {

sLabel = "Rulename: " + padr(this["rulename"+i]);
lbxAddressDisplay.addItem(
sLabel,
{id:this["id"+i],
date:this["date"+i],
time:this["time"+i],
user:this["user"+i],
flowid:this["flowid"+i],
pid:this["pid"+i],
sip:this["sip"+i],
dip:this["dip"+i],
smask:this["smask"+i],
dmask:this["dmask"+i],
sport:this["sport"+i],
dport:this["dport"+i],
rulename:this["rulename"+i],
prio:this["prio"+i],
adv1:this["adv1"+i],
adv2:this["adv2"+i],
adv3:this["adv3"+i],
shared:this["shared"+i],
shared:this["shared"+i]

}

);

}


}
if (!isAdd) {
dtfMsg.text = this.n + " Records are loaded. Click any record to view, edit or delete it, or click the Add Record button to add a new one.";
} else {
dtfMsg.text = "Record has been added. Enter a new record and click Save to save it, or click any record to view, edit or delete it.";
}
// clear record editing fields
for (i in gaFields) {
mcFields["dtf" + gaFields[i].name].text = '';
}
}

lvAddressData.cond = gsFilter;
lvAddressData.tab = gsFilter2;
//trace("condition = " + lvAddressData.cond);
lvAddressData.sendAndLoad(sFileLoc + "love.php", lvAddressData, "POST");
//lvAddressData.send(sFileLoc + "love.php", "newwin", "POST");

}

// function to set global filter variables according to user's choice
function checkFilter(compPassed) {
gsFilter = compPassed.getSelectedItem().data;
dtfMsg.text = "Loading records for " + compPassed.getSelectedItem().label;
// clear fields and hide buttons which might have been previously displayed for
// a selected record
for (var i in gaFields) {
mcFields["dtf" + gaFields[i].name].text = '';
}
btnSaveChanges._visible = false;
btnDeleteRecord._visible = false;
// update display
lbxAddressDisplay.removeAll();
dataLoad(false);

}

cboFilter.setChangeHandler("checkFilter", this);

function checkFilter2(compPassed) {
gsFilter2 = compPassed.getSelectedItem().data;
lbxAddressDisplay.removeAll();
dataLoad(false);

}
combo1.setChangeHandler("checkFilter2", this);

if you want to see the full actionscript
YOu can download it at http://www.martialdesigns.com/rules/getiface.as
and
http://www.martialdesigns.com/rules/index.as

I do include the
lbxAddressDisplay.removeAll();
So I donot know whats wrong.
Any help will be greatly appreciated

Thanks
Louis
bonechair is offline   Reply With Quote
Old 12-04-2002, 10:17 AM   #2
bonechair
Registered User
 
bonechair's Avatar
 
Join Date: Dec 2002
Posts: 12
Send a message via Yahoo to bonechair
Smile

Sorry

ActionScript Code:
// function to GET DATA from address book into listbox // isAdd = true if user has just added a new record function dataLoad(isAdd) { var sLabel, i; lvAddressData.onLoad = function() { lbxAddressDisplay.removeAll(); combo1.removeAll(); combo1.addItem("Assign To?",11); for (i=0; i<this.n; i++) { if (this["thename"+i] == null){ } else { combo1.addItem(padr(this["thename"+i]),padr(this["thedata"+i])); } if (this["rulename"+i] == null){ } else { sLabel = "Rulename: " + padr(this["rulename"+i]); lbxAddressDisplay.addItem( sLabel, {id:this["id"+i], date:this["date"+i], time:this["time"+i], user:this["user"+i], flowid:this["flowid"+i], pid:this["pid"+i], sip:this["sip"+i], dip:this["dip"+i], smask:this["smask"+i], dmask:this["dmask"+i], sport:this["sport"+i], dport:this["dport"+i], rulename:this["rulename"+i], prio:this["prio"+i], adv1:this["adv1"+i], adv2:this["adv2"+i], adv3:this["adv3"+i], shared:this["shared"+i], shared:this["shared"+i] } ); } } if (!isAdd) { dtfMsg.text = this.n + " Records are loaded. Click any record to view, edit or delete it, or click the Add Record button to add a new one."; } else { dtfMsg.text = "Record has been added. Enter a new record and click Save to save it, or click any record to view, edit or delete it."; } // clear record editing fields for (i in gaFields) { mcFields["dtf" + gaFields[i].name].text = ''; } } lvAddressData.cond = gsFilter; lvAddressData.tab = gsFilter2; //trace("condition = " + lvAddressData.cond); lvAddressData.sendAndLoad(sFileLoc + "love.php", lvAddressData, "POST"); //lvAddressData.send(sFileLoc + "love.php", "newwin", "POST"); } // function to set global filter variables according to user's choice function checkFilter(compPassed) { gsFilter = compPassed.getSelectedItem().data; dtfMsg.text = "Loading records for " + compPassed.getSelectedItem().label; // clear fields and hide buttons which might have been previously displayed for // a selected record for (var i in gaFields) { mcFields["dtf" + gaFields[i].name].text = ''; } btnSaveChanges._visible = false; btnDeleteRecord._visible = false; // update display lbxAddressDisplay.removeAll(); dataLoad(false); } cboFilter.setChangeHandler("checkFilter", this); function checkFilter2(compPassed) { gsFilter2 = compPassed.getSelectedItem().data; lbxAddressDisplay.removeAll(); dataLoad(false); } combo1.setChangeHandler("checkFilter2", this);
bonechair is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:52 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.