Microsoft KB Archive/888701

= BUG: Items in a drop-down list control are unexpectedly removed in InfoPath 2003 Service Pack 1 =

Article ID: 888701

Article Last Modified on 7/28/2006

-

APPLIES TO


 * Microsoft Office InfoPath 2003, Service Pack 1 (SP1)

-





SYMPTOMS
When you click an item in a drop-down list control, and then you reopen the drop-down list control, you notice that all items in the drop-down list control are unexpectedly removed, except the last item. This problem occurs in Microsoft Office InfoPath 2003 Service Pack 1 (SP1).



CAUSE
The view does not update when the value of the drop-down list changes.



WORKAROUND
To work around this problem, force the view to update when the drop-down list control changes. To force the view to update, follow these steps:  Start InfoPath. Open the form.

The drop-down list control should be in Design mode. Right-click the drop-down list control, and then click Drop-Down List Box Properties. In the Drop-Down List Box Properties dialog box, click Data Validation on the Data tab. In the Data Validation dialog box, click OnAfterChange in the Event drop-down list.  In the Microsoft Script Editor window, click Edit. Put the following code example in the OnAfterChange event handler. XDocument.View.ForceUpdate;  </li>  The event handler function will look as follows. function msoxd__choices__MyChoice::OnAfterChange(eventObj) {  XDocument.View.ForceUpdate; } </li> On the File menu, click Save, and then close the Microsoft Script Editor window.</li> Click OK two times.</li></ol>

<div class="status_section">

STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed in the &quot;Applies to&quot; section.

<div class="moreinformation_section">

Steps to reproduce the problem
<ol>  Create an .xml file and put the following script in the file. Save the file as &quot;Choices.xml.&quot; <?xml version=&quot;1.0&quot; ?> <ChoiceXML> <MyChoice></MyChoice> </ChoiceXML> </li> Start InfoPath.</li> On the File menu, click Design a Form.</li> In the Design a new form pane, click New Blank Form.</li> In the Design Tasks pane, click Controls, and then add a Repeating Table to the form.</li> Type 1 for Number of columns, and then click OK.</li> On the Tools menu, click Data Connections.</li> In the Data Connections dialog box, click Add.</li> In the Data Connection Wizard, click to select the Receive data check box, and then click Next.</li> Click XML document, and then click Next.</li> Type the path of the &quot;Choices.xml&quot; file, and then click Next.</li> Click Finish, and then click Close.

Note Click No if you receive the following message:

The selected file is not part of the form, which means it might not be accessible from other computers. Do you want to add this file to your form so that it will be accessible from other computers?

</li> On the View menu, click Data Source, and then click choices Secondary in the Data source drop-down list.</li> <li>Expand ChoiceXML, right-click MyChoice, and then click Drop-Down List Box.</li> <li>Right-click the drop-down list box control, and then click Drop-Down List Box Properties.</li> <li>In the Drop-Down List Box Properties dialog box, click the Data tab, and then click Look up values in the form's data source.</li> <li>Click Select XPath next to the Entries box.</li> <li>In the Select a Field or Group box, expand all the fields, click field1, and then click OK two times.</li> <li>On the Standard toolbar, click Preview Form.</li> <li>Click Insert Item two times, type test, type test1 , and then type test2 in each text box respectively in the Repeating Table control.</li> <li>Click the My Choice drop-down list.

Notice that test, test1, and test2 are listed.</li> <li>Click test.</li> <li>Click the My Choice drop-down list again.

Notice that only test is listed.</li></ol>

Keywords: kbtshoot kbbug kbprogramming kbxml KB888701

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.