Define current node value based on Secondary ds - InfoPath Dev
in

InfoPath Dev

Define current node value based on Secondary ds

Last post 12-11-2005 10:42 PM by Coita Thierry. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 12-02-2005 12:45 AM

    Define current node value based on Secondary ds

    Hi,

    Somebody has asking me a question that I can solve here it is:

    You have in a primary ds a reapeating choice section and in this you have two fields from a secondary datasource and other from primary!

    And with a onafter change event or a rules based on this field of secondary DS you need to populate the current reapeating choice section of the primary DS!

    How you make?

    With a button it's easy but without? Is it possible?

    Thanks from this user

    Thierry
    Infopath 2007, Langage: C#2.0 (Modèle Objet 2003)
    merci de lire ceci
  • 12-02-2005 07:08 AM In reply to

    Re: Define current node value based on Secondary ds

    I used this tutorial when doing something similiar - it helped a lot!
    http://www.infopathdev.com/howto/tutorials/default.aspx?i=d663d7df90e94e65abb02632966e8127

    Using the index that you create with that tutorial it should be easy to reference which repeating section you're currently on, and then reference the nodes within this repeating section to make appropriate changes.

    ---------------
    Matt Faus
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 12-08-2005 07:00 AM In reply to

    Re: Define current node value based on Secondary ds

    Hi Matt,

    Thanks for your reply! And sorry for my answer but this week I'm sick so I work only when I have the idea clear in my head!

    I am a little bit confusing on your answer!If I try to select my current row of my primary datasource with :

    IXMLDOMNode test = thisXDocument.DOM.selectSingleNode("/AV/AVel[position()=count(../preceding-sibling::AVel) + 1]")


    when I am on a onafterchangeevent from a field of a secondary DS!

    This send me always the first row of AVel!

    What you would mean in your answer? I don't believe that I have good understand what would you say?

    Thanks for your help!

    ++

    Thierry
    Infopath 2007, Langage: C#2.0 (Modèle Objet 2003)
    merci de lire ceci
  • 12-08-2005 11:15 AM In reply to

    Re: Define current node value based on Secondary ds

    quote:
    Originally posted by Virgul


    With a button it's easy but without? Is it possible?



    I'm not sure I understand your question. If it's easy to do with a button, can't you just put the code/rules that you used to do it with a button somewhere else - like in an onAfterChange event? Sorry if I'm misunderstanding.

    ---------------
    Matt Faus
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 12-08-2005 10:39 PM In reply to

    Re: Define current node value based on Secondary ds

    Thanks for your reply Matt! I will explain one more time!

    In design mode you have a reapeating section of a primary ds in this you have a field of a secondary ds! This field is always the same in each row of this reapeating section (control cannot repeat here)!

    ok ?

    On this field of the secondary ds I have a onafterchange event and I want to know which is the current row of the repeating section (primary ds)? the first, the third, the last, ...

    With a button in this repeating section it's easy you can make "e.source" and you have the current node! but without in the onafterchange event of the field of the secondary ds is it possible?

    I hope that is clear now.

    Thierry
    Infopath 2007, Langage: C#2.0 (Modèle Objet 2003)
    merci de lire ceci
  • 12-09-2005 07:39 AM In reply to

    Re: Define current node value based on Secondary ds

    Ok, I think I see what you're saying now. I think the problem is not that the field is in the 2DS but that it is not repeating. If you put a non-repeating control inside a repeating control each repetition of the control from the 2DS is simply a copy of the first. If you make a change to any of the 2DS controls the change is reflected in every instance of the repeating section. However, if you change the 2DS control it does not fire a onAfterChange event on the repeating section but only on the 2DS node.

    If the 2DS control was repeating you could put it in a group with another field called ID and use the tutorial mentioned above to keep track of which row was being modified.

    After playing around a little bit, I think this is impossible within the onAfterChange event of the 2DS field. You'll have to use some kind of trickery like making a field in the repeating section in the primary DS and then copying over to the 2DS and changing every instance manually.

    ---------------
    Matt Faus
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 12-11-2005 10:42 PM In reply to

    Re: Define current node value based on Secondary ds

    Ok so I will say to the person that is not possible with this configuration and he has to choose another way!

    put a button or put this field in the primary datasource!

    Thanks a lot

    ++

    Thierry
    Infopath 2007, Langage: C#2.0 (Modèle Objet 2003)
    merci de lire ceci
Page 1 of 1 (7 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.