populating extensible section with xml - InfoPath Dev
in

InfoPath Dev

populating extensible section with xml

Last post 10-05-2005 12:30 AM by kakashi1978. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 10-04-2005 02:47 AM

    populating extensible section with xml

    Hello,

    I have a problem when populating textbox with data from secondary data source xml.
    I explain:

    1- I have a repeating section with 1 dropdown listbox and 4 textboxes.
    2- the dropdown listbox is linked to a field "nom" in an xml secondary data source file
    3- when I select a name in the listbox, I would like to fill automatically textboxes in the item of the repeating section
    here is the xml file:
    <Questions>
    <Question nom="question1">
    <id>id_question1</id>
    <type>QCM</type>
    <duree>5</duree>
    <difficulte>1</difficulte>
    </Question>
    <Question nom="question2">
    <id>id_question2</id>
    <type>QRM</type>
    <duree>10</duree>
    <difficulte>2</difficulte>
    </Question>
    <Question nom="question3">
    <id>id_question3</id>
    <type>QMeC</type>
    <duree>15</duree>
    <difficulte>5</difficulte>
    </Question>
    <Question nom="question4">
    <id>id_question4</id>
    <type>QSL</type>
    <duree>30</duree>
    <difficulte>4</difficulte>
    </Question>
    </Questions>
    4- To do it I made a rule for each field to fill. This rule must fill the texbox associated with data matching the field "nom" selected. I do not want to display all question node in the form, only which ones selected in dropdownlist in the repeating section!
    5- here is an example for a rule to fill "id" field:
    xdXDocument:GetDOM("GetQuestionList")/dfs:myFields/dfs:dataFields/tns:GetQuestionListResponse/tns:GetQuestionListResult/Questions/Question/id[../@nom = xdXDocument:get-DOM()/my:mesChamps/my:section_question/my:groupe_question/my:section_extensible_question/my:nom_question]
    or in a simple way:
    id[@nom = nom_question]

    6- the problem is that when I have only one section in my repeating section, all work very well! But when I have many sections in the repeating section, rules sometimes display data not matching the field "nom" selected!
    It seems to appear when I select for the second time a field already selected above. In fact, data displayed match the first section fields and not which one asked.

    Can someone help me to solve this problem?
    Hope I clear enough to be helped! :)

    Thanks

  • 10-04-2005 11:59 AM In reply to

    Re: populating extensible section with xml

    The problem is most likely coming from the get-DOM() call. You should be using current() instead -- which requires a manual update. This topic has been discussed before. Do a search in these Forums for "current()" and the results should give you enough info to go on.

    Greg Collins [InfoPath MVP]
    InfoPath Dev
  • 10-05-2005 12:30 AM In reply to

    Re: populating extensible section with xml

    Ok !

    I found my problem!

    here is the solution:
    xdXDocument:GetDOM("GetQuestionList")/dfs:myFields/dfs:dataFields/tns:GetQuestionListResponse/tns:GetQuestionListResult/Questions/Question/id[../@nom = current()]

    Use of current() solve the problem because the rule is linked on the droplist box "nom_question"

    thank you very much for your help!

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