U
undercups
his is a hybrid problem i.e. the answer lies either in javascript or
vb.net so forgive me if this is the wrong group.
I have this javascript:
function moveItems(fromItem, toItem)
// Moves selected items from one ListBox to another.
{
var NoofItems = fromItem.options.length
for (i=0; i < NoofItems; i++)
{
if (fromItem.children.selected )
{
var anode = fromItem.children.cloneNode (true)
toItem.appendChild(anode)
fromItem.removeChild(fromItem. children)
NoofItems = fromItem.children.length
i--
}
}
}
which when called appears to move an item from 1 listbox to another.
However in vb.net when I run this code
If TeamDivisions.Items.Count > 0 Then
For intCount = 0 To TeamDivisions.Items.Count -
1
.WriteStartElement("TeamDivisi ons")
TeamDivisions.SelectedIndex = intCount
.WriteAttributeString("Divisio nId",
TeamDivisions.SelectedItem.Val ue)
.WriteEndElement()
Next
End If
the TeamDivisions.Items.Count returns 0 even when I know there are rows
in the control.
Any ideas why this control cannot be accessed in vb.net? In vb.net's
immediate window I can access the listbox from which the items are
removed to the above control using Items.Count, SelectedIndex,
SelectedItem.Value without a problem but the receiving list listbox
i.e. TeamDivisiones doesn't work at all.
Does the problem lie with my javascript?
Thanks for your help
Duncan
vb.net so forgive me if this is the wrong group.
I have this javascript:
function moveItems(fromItem, toItem)
// Moves selected items from one ListBox to another.
{
var NoofItems = fromItem.options.length
for (i=0; i < NoofItems; i++)
{
if (fromItem.children.selected )
{
var anode = fromItem.children.cloneNode (true)
toItem.appendChild(anode)
fromItem.removeChild(fromItem. children)
NoofItems = fromItem.children.length
i--
}
}
}
which when called appears to move an item from 1 listbox to another.
However in vb.net when I run this code
If TeamDivisions.Items.Count > 0 Then
For intCount = 0 To TeamDivisions.Items.Count -
1
.WriteStartElement("TeamDivisi ons")
TeamDivisions.SelectedIndex = intCount
.WriteAttributeString("Divisio nId",
TeamDivisions.SelectedItem.Val ue)
.WriteEndElement()
Next
End If
the TeamDivisions.Items.Count returns 0 even when I know there are rows
in the control.
Any ideas why this control cannot be accessed in vb.net? In vb.net's
immediate window I can access the listbox from which the items are
removed to the above control using Items.Count, SelectedIndex,
SelectedItem.Value without a problem but the receiving list listbox
i.e. TeamDivisiones doesn't work at all.
Does the problem lie with my javascript?
Thanks for your help
Duncan