Repeating Table with 3 DD , Dynamic Query - InfoPath Dev
in

InfoPath Dev

Repeating Table with 3 DD , Dynamic Query

Last post 11-24-2005 12:20 PM by Richard. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 11-23-2005 05:48 PM

    Repeating Table with 3 DD , Dynamic Query

    A Repeating table has 3 drop downs in each row.
    dd1, dd2, dd3

    on selecting dd1, a query is made to the web service using query fields filtered by value of dd1 and the results will populate dd2.

    same thing for dd2 and dd3.
    this works fine,
    now, we add the next row in the table, and select dd1, dd2, and we seem to have correct populated results in row 2 also..

    But, if one goes back to row 1.. you see that dd3 has the same list as dd3 for row 2.. ??
    This is because the query to the web service populates all dd3's the same way ?? ,

    What is a good way to accomplish this ??
  • 11-23-2005 07:22 PM In reply to

    Re: Repeating Table with 3 DD , Dynamic Query

    Hi Richard,

    So, you are using code for this, right? Can you post?
    If you are using the OnAfterChange event to trigger the WS call, rather than absolute XPath, are you using code such as:
    IXMLDOMNode oNode = e.Site.selectSingleNode("..");
    IXMLDOMNode oField1 = oNode.selectSingleNode("my:field1");
    IXMLDOMNode oField2 = oNode.selectSingleNode("my:field2");
    IXMLDOMNode oField3 = oNode.selectSingleNode("my:field3");
    where field1 would be linked to dd1, field2 t dd2 and field3 to dd3.


    Regards,

    Franck Dauché
    InfoPathDev
  • 11-24-2005 10:30 AM In reply to

    Re: Repeating Table with 3 DD , Dynamic Query

    Hi Franck,
    I did not understand your solution.
    I am using code , but it is rather mixed with bunch of stuf , not easy to show.
    basically the real problem is the way the webservice results gets linked to a field. since the webservice results are not row dependant , then a call to the webservice will effect all of the rows.
    The only I can think of, is when I call the web service, pass the row number, so when the results comes in I would have a row number as an attribute. then , have the results fill up an xml file, each time the row attribute changes ,the results will replace the content of the xml file for that row.. so the file gets to update each time the web service is called for a particular row, without effecting the previous results for the other rows. then , have a data connection from this file to the dd3.

    What do you think ?
  • 11-24-2005 11:08 AM In reply to

    Re: Repeating Table with 3 DD , Dynamic Query

    Hi,

    I am not sure how you do it exactly. One way to do this in my mind would be to have a OnAfterChange event triggered by dd1 and call a WS to fill dd2 and another behind dd2 to fill dd3. If you are doing this, you could use the code that I posted above.
    Otherwise, in general, to get IP to point to the right instance of a repeating table, you need to use current() or to use code such as:
    IXMLDOMNode oNode = thisXDocument.DOM.selectSingleNode("/my:myFields/my:group1/my:group2[n]/my:field1");
    to point to field1 of the row # n.

    Hope that it helps.

    Regards,

    Franck Dauché
    InfoPathDev
  • 11-24-2005 11:43 AM In reply to

    Re: Repeating Table with 3 DD , Dynamic Query

    In my entry for the dd3 , I have this:

    /dfs:myFields/dfs:dataFields/tns:MarkLogicDistinctQueryResponse/tns:MarkLogicDistinctQueryResult/result/option/subresult[../@name = current()/../my:Choice[position()]/my:OptionName]

    but what this does, effects all dd3s with the current one., notice that since I am calling web service each time, I am selecting dd2, therefore, the results coming back can only contain values related for that row.
  • 11-24-2005 12:20 PM In reply to

    Re: Repeating Table with 3 DD , Dynamic Query

    I think this should work :
    1- I have to disconnect dd3 entry from the webservice. ( How can I do this ? )
    2- OnAfterchange of dd2 call the webservice, and with the result replace the dd3 node of that row:

    objDO.Query();

    IXMLDOMNode fieldValue2 = thisXDocument.DOM.selectSingleNode("/my:myFields//my:Choices/my:Choice["+System.Convert.ToString(currow)+"]/my:SelectBy");

    now fieldvalue2 points to my dd3 at current row,

    wsDOM.selectSingleNode("/dfs:myFields/dfs:dataFields/tns:MarkLogicDistinctQueryResponse/tns:MarkLogicDistinctQueryResult/result/option/subresult")

    and this points to the results from web service.
    How can I replace the fieldValue2 with this ?

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