Filter problem by filtering sub repeating section - InfoPath Dev
in

InfoPath Dev

Filter problem by filtering sub repeating section

Last post 04-11-2008 11:03 AM by Greg Collins. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 04-10-2008 01:52 AM

    Filter problem by filtering sub repeating section

    Hello all,

     I have a repeating table and the table contains a sub repeating group. User can filter the table by textfields using for filterss.
    My xml structure ist following:

    <my:myFields xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2005-11-03T09-00-35">

     <my:Recipe>
      <my:RecipeName>Name1</my:RecipeName>
      <my:ParameterSection>
       <my:Parameter>
        <my:PName>P1</my:PName>
        <my:EIName>Ei1</my:EIName>
       </my:Parameter>
       <my:Parameter>
        <my:PName>P2</my:PName>
        <my:EIName>Ei2</my:EIName>
       </my:Parameter>
       <my:Parameter>
        <my:PName>P3</my:PName>
        <my:EIName>Ei3</my:EIName>
       </my:Parameter>
      </my:ParameterSection>
     </my:Recipe>
     
     <my:Recipe>
      <my:RecipeName>Name2</my:RecipeName>
      <my:ParameterSection>
       <my:Parameter>
        <my:PName>P1</my:PName>
        <my:EIName>Ei1</my:EIName>
       </my:Parameter>
       <my:Parameter>
        <my:PName>P2</my:PName>
        <my:EIName>Ei2</my:EIName>
       </my:Parameter>
       <my:Parameter>
        <my:PName>P3</my:PName>
        <my:EIName>Ei3</my:EIName>
       </my:Parameter>
      </my:ParameterSection>
     </my:Recipe>
     
     <my:Recipe>
      <my:RecipeName>Name3</my:RecipeName>
      <my:ParameterSection>
       <my:RecipeParameter>
        <my:PName>a</my:PName>
        <my:EIName/>
       </my:RecipeParameter>
       <my:RecipeParameter>
        <my:PName>b</my:PName>
        <my:EIName/>
       </my:RecipeParameter>
       <my:RecipeParameter>
        <my:PName>c</my:PName>
        <my:EIName/>
       </my:RecipeParameter>
      </my:ParameterSection>
     </my:Recipe> 

     <my:Filter>
      <my:FilterRecipeName></my:FilterRecipeName>
      <my:FilterPName></my:FilterPName>
     </my:Filter>

    </my:myFields>

    The filter is set in the master table of <my:Recipe>.
    Following filter works fine:
      "contains(my:RecipeName, //my:FilterRecipeName)"
      Example:
      "contains(my:RecipeName, 'Name3')"
      Result:
      - 1 Recipe is shown in the table

    Following filter doesn't work correct:
      "contains(my:RecipeName/my:ParameterSection/my:RecipeParameter/my:PName, //my:FilterPName)"  --> filter looks in the first element of <my:RecipeParameter>
      ".//my:RecipeParameterSection/my:RecipeParameter[contains(my:PName, //my:FilterPName)]"  --> filter works in xml spy good, but in InfoPath it works not correct

     I had tried many filters and had no found a correct solution. 

    I hope you can understand my problem and anybody knows a solution?

    Thanks.

    Mancha

     

  • 04-11-2008 11:03 AM In reply to

    Re: Filter problem by filtering sub repeating section

    contains() only works on a single node, not a node-set. That's the problem.

    You might be able to do something like:

    /my:ParameterSection/my:RecipeParameter/my:PName[contains(., //my:FilterPName)]

     

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