How To UnSet a DropDownList in COde?

B

Barry Prentiss

Hi,
I need to set a dropdown list that is populated from a secondary datasource
back to an unset condition after a button-click.
I tried
objSrcXDoc.DOM.selectSingleNode("/my:myFields/my:projInfoSection/my:ChildProjSection/my:ExistingChildSection/my:ChildFormID").Text
= ""
This doesn't seem to work.
Is there another property a can use to unset the selected value?
Thx,
Barry
 
S

Swathi (GGK Tech)

Hi,
One work around here is, add two drop down list boxes to the form having
binded to same field. Add a Boolean type hidden field to the data source with
the default value as false. Add conditional formatting for those controls as
if the hidden field is true then hide the first drop down which has values
coming from secondary source. And if the hidden field is false then hide the
second drop down. In the button click event, set the hidden field value to
true.
 
S

Shiva (GGK Tech)

Hello,

You have to remove the existing repeating nodes from your secondary data
source. For this you have to use the below statement,

objSrcXDoc.DOM.selectNodes(“/my:myFields/my:projInfoSection/my:ChildProjSection/my:ExistingChildSection").removeAll();
 
S

Shiva (GGK Tech)

Hello,

You have to remove the existing repeating nodes from your secondary data
source. For this you have to use the below statement,

objSrcXDoc.DOM.selectNodes(“/my:myFields/my:projInfoSection/my:ChildProjSection/my:ExistingChildSection").removeAll();
 
B

Barry Prentiss

Thx Shiva,
Class IXMLNodeList does not have a removeAll() function (item, length,
nextNode() and reset())
I tried .reset(), but that does not affect the form display.
Any other suggestions?
Barry
 
S

Swathi (GGK Tech)

Hi,
Remove all function is available for the dom selection. Try the following.
((IXMLDOMSelection)
(objSrcXDoc.DOM.selectNodes(“/my:myFields/my:projInfoSection/my:ChildProjSection/my:ExistingChildSection"))).removeAll();
 
B

Barry Prentiss

Thx Swathi,
Unfortunately, this call removes the ExistingChildSection (and it's
dropdown list) from the parent form altogether.
I got errors until called it like this:

Dim objSelection
set objSelection =
objSrcXDoc.DOM.selectNodes("/my:myFields/my:projInfoSection/my:ChildProjSection/my:ExistingChildSection")
objSelection.removeAll()

Then I added:
objSrcXDoc.DataObjects("DAM.FDS.GetChildProjects").query()
objSrcXDoc.View.ForceUpdate()

But the dropdown in the ExistingChildSection was not there to populate.

Any other suggestions?

Thx,
Barry
 
S

Shiva (GGK Tech)

Hello,

If we used the removeAll() function it will removes all existing node from
that list. If you want to still there one node then we can add the filter
condition to not remove the first node from that list.
Filter is:

set objSelection =
objSrcXDoc.DOM.selectNodes("/my:myFields/my:projInfoSection/my:ChildProjSection/my:ExistingChildSection[position() != 1]")

This will gives the node list does not contains the first node.
One more solution is after deleting all nodes then you have to add one node
(ExistingChildSection) to ‘ChildProjSection’ node.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top