OData - Querying for data on Multiple-selection list box change event - IP2010 - InfoPath Dev
in

InfoPath Dev

OData - Querying for data on Multiple-selection list box change event - IP2010

Last post 05-28-2013 01:50 AM by manupm87. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 05-27-2013 12:52 AM

    • manupm87
    • Not Ranked
      Male
    • Joined on 05-24-2013
    • Spain
    • Posts 5

    OData - Querying for data on Multiple-selection list box change event - IP2010

    Hello everyone :) I'm developing a web based form in which two or more Multiple-selection List Boxes ("MLB") are "in cascade". That means that different data would be loaded on the second MLB depending on which options are marked on the first MLB.

    As filtering over these kind of controls causes innecesary postbacks to the Sharepoint Server, I decided to use OData REST web services (something extremely flexible for querying for data instead of common data connections, learnt thanks to this community).

    The OData REST URL is dynamically updated, on any change on the first MLB. And here comes the problem:

    1. Changes on MLB seems to be handled only when selecting items, but not when deselecting.
    2. On the other hand, I'm using an extra field with the "eval" function to retrieve items selected on first MLB and dynamically update OData REST URL (as I said before). It updates perfectly on both marking and unmarking items on MLB. But I cannot assign the "Query for data" action to the "change" event of this control because this warning message is shown (it works though after closing the warning): "XML data that is required for this form to function correctly cannot be found." It is shown any time the form is renderized.

    So, to summarize, querying for data works perfectly when assigned to MLB change event, -as well as if assigned to a button press or anythin "manually" changed- but unmarking items in MLB does not trigger the event.

    Assigning "query for data" to a change event on a control that is "automatically" changed works, but the warning message is shown, so it is not a valid approach unless this warning could be ommited.

    So, any help to this matter would be really appreciated.

    (Obviously, I'm not allowed to use a button or anything that includes extra clicks to query for data. Second MLB must be updated on first MLB changes). A capture is attached just for clarifying ;) Thank you very much!!


  • 05-27-2013 09:29 AM In reply to

    Re: OData - Querying for data on Multiple-selection list box change event - IP2010

    A known quirk about MSLBs is that they only trigger rules when an item is selected, and default value formulas that depend on MSLBs only trigger rules when items are deselected. When you put these together, you can create a way to trigger rules both upon selection and deselection, but it seems that you're running into a bit of an issue on load.

    Are you able to observe what the URL is in the calculated field when it causes the error on load? Is it perhaps a URL that would not be valid for querying the OData service? If so, perhaps you could add this condition to the Query Data rule on that field:

    MSLBField is not blank

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 05-27-2013 10:35 AM In reply to

    • manupm87
    • Not Ranked
      Male
    • Joined on 05-24-2013
    • Spain
    • Posts 5

    Re: OData - Querying for data on Multiple-selection list box change event - IP2010

    I think what you say about triggering rules only on items deselection works on non-web-based-forms. In my case (web-form), "Tab filter" control is always updating, both on selection and deselection. And its value is basically a concat with the MLB selected values.

    It is on this control change event that the next field is calculated: "Sanitized tab filter".

    And once again, on changes on this last control, "QueryConfig URI" is completed.

    So finally, on changes in "QueryConfig URI" control, REST URL Value (OData web service) is changed, and then "Query for data" is called.

    The rule you tell me seems a valid solution to the warning displayed on load (I'll figure it out tomorrow), but the problem is that the warning message is populated on any "query for data", so it is shown on any selection/deselection in the first MLB.

    (As I explained before, if I assign the "Query for data" to the MLB change event -and not to a text field change event- it works fine, but only triggers on seleciton.)

    Thank you very much for your answer!! :)

  • 05-28-2013 12:28 AM In reply to

    • manupm87
    • Not Ranked
      Male
    • Joined on 05-24-2013
    • Spain
    • Posts 5

    Re: OData - Querying for data on Multiple-selection list box change event - IP2010

    Jimmy:

    MSLBField is not blank

     

    Confirmed -> As expected, that rule avoids warning message on load.

    Anyway, it is still being showed when retrieving data from changed REST URL. Might not be any setting on server side that disables this kind of warning checkings??

    Thanks in advance! ;)

  • 05-28-2013 01:50 AM In reply to

    • manupm87
    • Not Ranked
      Male
    • Joined on 05-24-2013
    • Spain
    • Posts 5

    Re: OData - Querying for data on Multiple-selection list box change event - IP2010

    Amazingly,

    All trouble came to vanishment when grouping all rules into the same control. Do not have I any explanation for that behavior, though, application works fine.

    Thanks Jimmy for your time.

    See you!

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