xdXDocument:get-DOM() doesn't give the current nod - InfoPath Dev
in

InfoPath Dev

xdXDocument:get-DOM() doesn't give the current nod

Last post 11-15-2005 12:21 AM by Patrick Halstead. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 10-02-2005 01:50 PM

    • IceT
    • Not Ranked
    • Joined on 10-02-2005
    • Posts 2

    xdXDocument:get-DOM() doesn't give the current nod

    I believe tha my problem is basically this:
    "xdXDocument:get-DOM()/my:expensesReport/my:events/my:event/my:action" gives always the value of the first event in the repeating table. I tried to use the "[count(preceding-sibling::my:evento) +1]" after "my:event" in that expression, but it didn't work.

    This is my XML

    <events>
    <action category="Transport">
    <type>Expense</type>
    ...

    I have the folowing expression
    xdXDocument:GetDOM("events")/events/action/@category[../type= xdXDocument:get-DOM()/my:expensesReport/my:events/my:events/my:action]

    This is what it is supposed to do: when my listbox ("my:action") says "Expense", I want to put the string "Transport" in a text field.

    If the expression were to be used like this: xdXDocument:GetDOM("events")/events/action/@category[../type = my:action]
    it would work.

    Can anyone help me? (have I explained enough the problem?)

    thanks
  • 10-03-2005 09:55 AM In reply to

    Re: xdXDocument:get-DOM() doesn't give the current nod

    You need to use the current() function in place of get-DOM().

    When you use get-DOM() you are always starting over from the beginning. current() picks up where you currently are at.

    So you expression (and you'd need to correct it according to your schema) would maybe look more like this:

    xdXDocument:GetDOM("events")/events/action/@category[../type = current()/../my:action]

    The XPath following the current() function needs to make sense according to the node you are "currently" on. The above assumes current() is equal to @category in the main DOM.

    Greg Collins [InfoPath MVP]
    InfoPath Dev
  • 10-03-2005 07:57 PM In reply to

    • IceT
    • Not Ranked
    • Joined on 10-02-2005
    • Posts 2

    Re: xdXDocument:get-DOM() doesn't give the current nod

    Man that did the trick! I trully don't know much about DOM programming, and anyways, I also didn't know nor where I was, nor that I could use the current() function to "find myself"! I believed to be in the secondary data source, and so the DOM function would be necessary.

    Thanks a lot!
  • 10-04-2005 12:03 PM In reply to

    Re: xdXDocument:get-DOM() doesn't give the current nod

    I believe that current() usually represents the node to which the control is bound.

    Greg Collins [InfoPath MVP]
    InfoPath Dev
  • 11-13-2005 09:35 PM In reply to

    Re: xdXDocument:get-DOM() doesn't give the current nod

    Hi There,

    Okay, here is my problem. I have a repeating table and a single button at the top of the form. When the user clicks on the SINGLE button I want the current selected row containing a checkbox to be flagged as TRUE/False depending on its previous state and then submitted to the dB. This sounds really simple but i dont know where to start. Im using JScript.

    Cheers
  • 11-15-2005 12:21 AM In reply to

    Re: xdXDocument:get-DOM() doesn't give the current nod

    Hi abs(Ming),
    You can do this with rules. In the Designer, double click on the button and click on Rules. Add a rule to set a fields' value and then add an xpath that refers to the pre-existing checkbox value. Should be straightforward.

    Patrick Halstead [InfoPath MVP]
    InfoPathDev
    Patrick Halstead
    Project Manager at Qdabra
Page 1 of 1 (6 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.