populating/displaying controls when datasource returns zero rows - InfoPath Dev
in

InfoPath Dev

populating/displaying controls when datasource returns zero rows

Last post 07-09-2009 02:26 AM by msparabola. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 07-07-2009 02:36 AM

    populating/displaying controls when datasource returns zero rows

    I have a datasource pulling a single row back from a view and some controls are populated with the fields on that datasource.  If the query returns zero rows from the view then my form appears to freeze after the static header and before the controls should appear.  I can't seem to set a default value on these fields/controls - is there a way to show the entire form but with blank controls when no data is retrieved?

  • 07-07-2009 05:44 AM In reply to

    Re: populating/displaying controls when datasource returns zero rows

    Sure, it's quite normal to show blank controls - they are almost always blank on form load anyway.  How exactly are these controls configured to show that data, and why can't you set default values?  Are you referring to controls bound to nodes on a secondary data connection?

  • 07-07-2009 05:50 AM In reply to

    Re: populating/displaying controls when datasource returns zero rows

    Yeah they are bound to a secondary data connection.  Under properties for either the controls or the source fields the 'default' box is disabled, I can't change that.  I'm sure I had the form loading (with blank controls) when the data was empty before I'm wondering if something else has changed.
  • 07-07-2009 05:52 AM In reply to

    Re: populating/displaying controls when datasource returns zero rows

    Yeah, you can't change data for your secondary data connections like that.  If you had data elements in your main data source, you could set their default values to something from the secondary data source using a filter, but that's a side thing.  Your form should not fail just because it returns no data from that source.  There has to be something funky about how its built.

  • 07-09-2009 02:26 AM In reply to

    Re: populating/displaying controls when datasource returns zero rows

    I've realised it is happening because I've got the controls within a Repeating Section.  At the time I created the template it seemed I had to put all the controls and fields within a repeating area to get them to bind correctly.  I'm only ever expecting one row (if data exists) but when no data is returned of course the repeating section doesn't get populated.  I think I need to put the controls onto the form outside of a repeating section.

     

    Edit - what I really want is to show the data as not repeating.  I'm only ever going to return one row if it exists.

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