Blank entry in list box and drop down listbox - InfoPath Dev
in

InfoPath Dev

Blank entry in list box and drop down listbox

Last post 12-08-2006 03:32 AM by Laeus. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 09-29-2006 02:48 AM

    Blank entry in list box and drop down listbox

    Hi,

    I've designed a form template with a number of list boxes and drop down listbox, all of which gets their values from a web service returning an xml document. All of these boxes seem to always have an empty/blank entry as the first item in the list. Eventhough the xml document does not have any blank fields.

    This only happens in InfoPath 2007 Beta2.

    Any ideas?

    Thx :)
  • 09-29-2006 10:33 AM In reply to

    Re: Blank entry in list box and drop down listbox

    Hello Frikkenator,

    What's happening is the node that stores the value of the drop-down list is blank, but since there is no coresponding display name with the value of "", then it simply shows the value which is "". I hope this makes sense.

    To remedy the problem you should define an option in your web service that returns "Select one..." with the value as "", or you could write code to automatically set the value of the node as the first value returned from the web service.

    I hope this helps!
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 10-02-2006 01:30 AM In reply to

    Re: Blank entry in list box and drop down listbox

    Hi Matt,

    Thank you for the reply. I've checked out the XML documents returned from the web services, and none of them contain empty nodes, in most cases I use the sam node for the display name and the value. I've even tried setting the list/dropdown list boxes' default value to 'Select...' which is then shown in the dropdown list, followed by all of the entries returned from the web service, but there is still an empty item right at the top, even before the default value.

    I know this version is still in BETA testing, which means it might be some unresolved issue, but I can't find anyone else having the same problem.

    Any ideas/info would be much appreciated.

    Thanks,
    Rudolph
  • 12-07-2006 02:05 PM In reply to

    • Laeus
    • Not Ranked
    • Joined on 12-07-2006
    • Posts 2

    Re: Blank entry in list box and drop down listbox

    Was a fix for this problem ever found?

    Im experieencing something similar now and this is the only reference I could find.

    Im using InfoPath 2007 Beta 2 also
  • 12-07-2006 07:56 PM In reply to

    Re: Blank entry in list box and drop down listbox

    quote:
    Originally posted by Laeus

    Was a fix for this problem ever found?

    Im experieencing something similar now and this is the only reference I could find.

    Im using InfoPath 2007 Beta 2 also



    Hi Laeus,

    Unfortunatly not really. I communicated this problem to MS, apparently this is by design. There is a fix for this according to them, I got the fix to work for forms opened in Infopath itself, but not for forms opened in a web browser using Infopath Forms Services. Below you can fand the fix according to MS. Hope this helps!

    quote:

    In regard to the above referenced bug, this behavior is by design and also occurs in InfoPath 2003. The reason this is “by design” is that in most cases you want to the user to make an explicit choice from the list – hence the blank line forces a selection (you could always add custom data validation to insure this field is not blank before the form is submitted, saved, etc.)

    Now, you can change this behavior in a couple of ways:

    - Add a “default value” to the node the list is bound to. Keep in mind, this will not remove the blank line but will simply cause a value to be displayed in the box when opened:
    o Open your form template in Design View
    o Display the Data Source task pane
    o Right-click on the node the list box is bound to and choose Properties
    o In the Default Value field, enter a value that corresponds to one of the values returned from the data source

    - Hand modify the XSL to either remove the blank line or add text to that entry so instead of being a blank line it would show something like “Select from this list…”
    o Open the XSN in Design View
    o From the File menu choose Save as source files and save these to a new folder
    o Open the view that contains the control displaying the blank line - search for an entry that looks similar to this:
    <select class="xdComboBox xdBehavior_Select" title="" style="WIDTH: 245px" size="1" xd:CtrlId="CTRL1" xd:xctname="dropdown" value="" xd:boundProp="value" xd:binding="my:field1" tabIndex="0">
    <option/>
    o To completely remove the blank line, simply remove the "<option/>" tag noted above:
    <select class="xdComboBox xdBehavior_Select" title="" style="WIDTH: 245px" size="1" xd:CtrlId="CTRL1" xd:xctname="dropdown" value="" xd:boundProp="value" xd:binding="my:field1" tabIndex="0">
    o To add some text to the blank line, modify the option tag:
    <select class="xdComboBox xdBehavior_Select" title="" style="WIDTH: 245px" size="1" xd:CtrlId="CTRL1" xd:xctname="dropdown" value="" xd:boundProp="value" xd:binding="my:field1" tabIndex="0">
    <option>Select from this list...</option>
    o Save and close the XSL
    o Right-click on Manifest.xsf and choose Design
    o From the File menu choose Save As and resave this as your XSN

    NOTE: By hand modifying the XSL, if any design changes are subsequently made to the view in the InfoPath editor (i.e. in Design View), then the hand modifications will be lost.

    Scott L. Heim, MCSD, MCSD.NET | Office InfoPath Beta | 980.776.9745 (work) | [email protected] | M-F, 9:00 AM - 6:00 PM ET


  • 12-08-2006 03:32 AM In reply to

    • Laeus
    • Not Ranked
    • Joined on 12-07-2006
    • Posts 2

    Re: Blank entry in list box and drop down listbox

    Thanks frik. I guess if its by design then I can a live with it... a bit of an annoyance really but I suppose they had a reason for doing it.

    Thanks for the info.
Page 1 of 1 (6 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.