Filtering drop down values based on input parameter - InfoPath Dev
in

InfoPath Dev

Filtering drop down values based on input parameter

Last post 04-21-2010 03:33 AM by Patrick Halstead. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 04-19-2010 02:21 PM

    Filtering drop down values based on input parameter

    I have a "names" dropdown that is populated via a secondary data source. I also have a text box where user can type in filter criteria (for first name, say). Now, via a "Search" button, I want to filter that list to values that contain the text.

    The button calls an XSL file - and I am trying to do the following:

    -----------------------------------------------------------------------

      <!-- Secondary Data Sources -->
     <xsl:param name="BusinessEntitiesDB" select="document('BusinessEntitiesDB.xml')"/>
     <!-- Identity Template -->
     <xsl:template match="@*|node()">
      <xsl:copy>
       <xsl:apply-templates select="@*|node()"/>
      </xsl:copy>
     </xsl:template>
     <xsl:variable name="var_FirstNameFilter" select="/my:CR1TI0001/my:search_facilitator_group/my:user_firstname_filter"/>
     <xsl:variable name="var_FirstNameValue" select="/my:CR1TI0001/my:search_facilitator_group/my:facilitator_firstname_search"/>
     
     <xsl:template match="/my:CR1TI0001/my:search_facilitator_group/my:facilitator_name_add">
     <xsl:copy>
         
       <xsl:choose>

        <xsl:when test="$var_FirstNameFilter='Contains'">
          <xsl:for-each select="$BusinessEntitiesDB/bmsBE:BusinessEntities/bmsBE:BusinessEntity[contains(bmsBE:Full_Name,$var_FirstNameValue)]"/>
          <xsl:apply-templates/>
        </xsl:when>
        
        <xsl:otherwise>
         <xsl:apply-templates/>
        </xsl:otherwise>
       </xsl:choose>
       
     </xsl:copy>
     </xsl:template>
    ----------------------------------------------------------------------------

    The problem is that nothing happens. The picklist values are in the field facilitator_name_add. Any help is appreciated!!

    Thanks

    Filed under:
  • 04-21-2010 03:33 AM In reply to

    Re: Filtering drop down values based on input parameter

    Are you including this secondary data source (BusinessEntitiesDB.xml) in your XSN? If so, just use the InfoPath filter option to filter and don't bother with complex XSLT since that will likely require code.  If you aren't including it and it isn't too large, you can load at runtime as a resource and still use the default filter semantics. If the XML is really huge, you should either a) put it in a DB or b) export it to a SharePoint list and use a web service on the server to filter. For option a) Qdabra has a web service (WSSP) that will help you. For option b) you can use Qdabra's qRules or FilterOWSSVR on SharePoint.

    Happy trails

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