populating listbox control using maindata source - InfoPath Dev
in

InfoPath Dev

populating listbox control using maindata source

Last post 05-08-2008 04:32 PM by Greg Collins. 9 replies.
Page 1 of 1 (10 items)
Sort Posts: Previous Next
  • 04-18-2008 04:31 AM

    • rohit
    • Top 500 Contributor
    • Joined on 03-17-2008
    • Posts 50

    populating listbox control using maindata source

    Hi,

    when i populates ListBox control using Main Data source it shows first field as blank,then onword it shows entries.

    I also tried using Secondary datasource it shows first field as blank,and onword shows data.

    How should i resolve this problem.

    Please Help..

     

    Thanks, 

     

     

  • 04-21-2008 04:40 PM In reply to

    Re: populating listbox control using maindata source

    Blank is typically a very useful value so that the user can choose no option at all. If you need to, you can set a default value on that field to which the drop-down control is bound and the user will be presented with that default value. If you absolutely don't want the blank option, you can either write code to prevent users from selecting it, or you can manually edit the view .xsl file to delete it--though this last option will get reset every time you modify that drop-down control and the XSL behind it is rebuilt.

  • 04-22-2008 05:15 AM In reply to

    • rohit
    • Top 500 Contributor
    • Joined on 03-17-2008
    • Posts 50

    Re: populating listbox control using maindata source

    How should i delet it from view.xsl

  • 04-22-2008 08:17 AM In reply to

    • Bleak
    • Top 500 Contributor
      Male
    • Joined on 04-16-2008
    • Germany
    • Posts 28

    Re: populating listbox control using maindata source

    When designing your form, choose "File" then "Save As Source Files..." and select a target folder. The view.xsl file will be saved into that folder. Open it with your favorite editor and find the <option /> tag (or tags). These tags are the "blank" options in your drop down list boxes.

  • 04-22-2008 10:02 PM In reply to

    • rohit
    • Top 500 Contributor
    • Joined on 03-17-2008
    • Posts 50

    Re: populating listbox control using maindata source

    Thanks a lot, Bleak

  • 04-23-2008 09:28 AM In reply to

    Re: populating listbox control using maindata source

    Just one last reminder that once you remove that blank option from the XSL, any change you make in the designer to that drop-down control will cause the XSL to be regenerated WITH the blank option, and you will need to manually remove it again. It can be a pain to do, so you might want to wait until you are close to finalized before doing these things.

  • 04-23-2008 10:28 PM In reply to

    • rohit
    • Top 500 Contributor
    • Joined on 03-17-2008
    • Posts 50

    Re: populating listbox control using maindata source

    Thanks Greg,

    But it solveed my problem.

  • 04-24-2008 04:22 PM In reply to

    Re: populating listbox control using maindata source

    Glad to have helped!

  • 05-08-2008 09:24 AM In reply to

    Re: populating listbox control using maindata source

    Hi Greg,

    I removed the blank option. Can you tell me how to get this change published to SharePoint? I noticed that I can't save the view.xsl while I have the form opened in design mode. Once I get out of design mode and save the view.xsl then I'm able to save. How do I now get these change to proprogate to the SharePoint server? For some reason, every time I go into design mode and then publish, the blank option comes back.

     Thanks.

     -Gil

  • 05-08-2008 04:32 PM In reply to

    Re: populating listbox control using maindata source

    Strange. The typical steps are:

    1. Extract your form files.
    2. Edit the view .xsl file to remove the blank option, and then save.
    3. Right-click the manifest.xsf file and choose Design.
    4. Republish as an XSN or to SharePoint or whatever.

    The Blank option should not come back unless you modify the drop-down list box control in the designer.

    However, are you using this as a browser form? I have never tried this with a browser form, and it might be something specific to that.

Page 1 of 1 (10 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.