Evaluating individual row within Repeating Table - InfoPath Dev
in

InfoPath Dev

Evaluating individual row within Repeating Table

Last post 10-27-2005 07:46 AM by vt_asparagus. 10 replies.
Page 1 of 1 (11 items)
Sort Posts: Previous Next
  • 10-18-2005 08:47 PM

    Evaluating individual row within Repeating Table

    I have a repeating table which is being used to mimic a multiple selection list-box as per the following link:
    http://blogs.msdn.com/infopath/archive/2004/04/01/106039.aspx

    To this end I have created a repeating group:

    <xsd:element name="Application">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element ref="my:Selected" minOccurs="0"/>
    <xsd:element ref="my:ApplicationName" minOccurs="0"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>

    I'd like to show/hide another section in the form using conditional formatting based upon a selection made within the repeating table, e.g. for a row where my:ApplicationName = "Other" I'd like to evaluate the value of my:Selected.

    I can evaluate this in managed code, but not using the standard InfoPath conditional formatting options. At the moment if I set up conditions for Selected=true and ApplicationName=Other it only displays the section if all instances of Selected are true.

    Alternatively, can I combine conditional formatting with managed code - i.e. show/hide a section using managed code rather than the InfoPath GUI?

    Thanks,
    David.
  • 10-18-2005 10:02 PM In reply to

    Re: Evaluating individual row within Repeating Table

    Hi David,

    You can use xdExtension for this. Do a search in this forum, I remember seeing several posts on it.

    Regards,

    Franck Dauché
  • 10-18-2005 10:55 PM In reply to

    Re: Evaluating individual row within Repeating Table

    Hi Franck,

    Thanks heaps, just what I was looking for. Looks like a very powerful feature.

    David.

  • 10-21-2005 12:54 AM In reply to

    Re: Evaluating individual row within Repeating Table

    ...well so I thought.

    Using an xdExtension function works just fine on the Conditional Formatting clause, however using the same expression in a Data Validation clause behaves erratically.

    Are there any issues with using an xdExtension function within the Data Validation condition?
  • 10-21-2005 04:50 AM In reply to

    Re: Evaluating individual row within Repeating Table

    I have used xdExtension a bit in the past but I have not tried to get it to work in Data Validation. I know I have had lots of success using it in Conditional Formatting and Rules.
    Jason
    http://www.k2distillery.com/
  • 10-21-2005 07:05 AM In reply to

    Re: Evaluating individual row within Repeating Table

    Same here, sorry David.

    Regards,

    Franck Dauché
  • 10-23-2005 09:18 PM In reply to

    Re: Evaluating individual row within Repeating Table

    Okay, thanks for the feedback - I was slowly going nuts trying to work out why it wasn't working.

    I'll try to figure out another way of achieving my goal.
  • 10-24-2005 11:13 PM In reply to

    Re: Evaluating individual row within Repeating Table

    Interesting thread. Not sure, but maybe these problems have something to do with event percolation and reentrancy. Why can't you just use a rule to set a field that you use in your conditional show/hide? Am I missing something?

    Patrick Halstead [InfoPath MVP]
    InfoPathDev
    Patrick Halstead
    Project Manager at Qdabra
  • 10-25-2005 01:30 AM In reply to

    Re: Evaluating individual row within Repeating Table

    Patrick,

    I've set up the conditional formatting as described above, using a xdExtension function, and it works fine. The problem comes when I try to use the same expression in a Data Validation clause.

    I placed a break point in function I'm calling with xdExtension and I tested that the return value was set to the correct value - although bizarrely the function is called twice each time a value changes within the repeating group.

    However the actual data validation behaves erratically...

    When the user selects a particular value from a repeating section, I want to evaluate a field and prevent submission if the field is blank, however what happens is:

    When the form is opened the option is deselected and the field is empty, the validation warning is displayed and the form can't be submitted. If select the option, the validation warning goes away and the form can be submitted even though the field is blank (the opposite of what I want!).

    I've played with the validation expression I'm using:
    xdExtension:OtherApplicationSelected() = true
    and it doesn't matter if I test for 'true' or 'false', the data validation behaves the same.

    It's a pity I can't post a .jpg of my form and the validation condition - it'd be easier to show you what I'm trying to do. :)

  • 10-25-2005 08:14 PM In reply to

    Re: Evaluating individual row within Repeating Table

    I've solved the problem.

    It lay in using '= true' in the expression - if I remove this and set the expression to be:
    xdExtension:OtherApplicationSelected()
    then the validation works fine.


  • 10-27-2005 07:46 AM In reply to

    Re: Evaluating individual row within Repeating Table

    <G><G> - I was just about to say "xdExtension:OtherApplicationSelected() = true" looked a little fishy.
    Jason
    http://www.k2distillery.com/
Page 1 of 1 (11 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.