Cascade dropdown in DIP (document information panel) - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Cascade dropdown in DIP (document information panel)

Last post 06-28-2017 03:50 PM by javicartin. 9 replies.
Page 1 of 1 (10 items)
Sort Posts: Previous Next
  • 02-02-2012 05:42 AM

    Cascade dropdown in DIP (document information panel)

    Hi,

    I'm designing a DIP form for Word 2007, using Infopath 2007. I've got 2 drop-down list boxes (Category, Product) connected to Sharepoint list.

    Properties of 'Category'
    Entries: /dfs:myFields/dfs:dataFields/dfs:CategoryRelationList
    Value: @ID
    Display name: @Category

    Properties of 'Product'
    Entries: /dfs:myFields/dfs:dataFields/dfs:CategoryRelationList
    Value: @ID
    Display name: @Title

    Main data source (DIP) Xpath:
    /pr:properties/p:properties/documentManagement/ns2:Product
    /pr:properties/p:properties/documentManagement/ns2:Category

    The 'Product' box must display values depending on 'Category'  (cascade dropdown).

    If I use filter on 'Product' box   /dfs:myFields/dfs:dataFields/dfs:CategoryRelationList[@Category = xdXDocument:get-DOM()/pr:properties/p:properties/documentManagement/ns2:Category] 
    the second box (Product) gets empty (no values) when I'm previewing form.

    If I use Category (Value:@Category , Display name: @Category) and filter Product  /dfs:myFields/dfs:dataFields/dfs:CategoryRelationList/@Title[../@Category = xdXDocument:get-DOM()/pr:properties/p:properties/documentManagement/ns2:Category]    form displays correct, but wit error (Only positive integers allowed)

    I've found second solution using current() function  (http://www.infopathdev.com/blogs/greg/archive/2005/07/14/Create-a-Repeating-Cascading-List-from-a-Flat-Data-Source.aspx), but I don't know how to use it in my case. 

    current()/xdXDocument:get-DOM()/pr:properties/p:properties/documentManagement/ns2:Category      error:Node-test expected.

    current()/ns2:Category    error: "ns2:Category'" does not point to a valid location path of a field or group.

    Please help me out,

    Regards, 
  • 02-02-2012 08:27 AM In reply to

    Re: Cascade dropdown in DIP (document information panel)

    Hi -

    Your main data source node isn't repeating, so current() shouldn't come into play.

    I just tried this - and my drop downs cascaded nicely:

    /dfs:myFields/dfs:dataFields/d:SharePointListItem_RW[d:Category = xdXDocument:get-DOM()/pr:properties/p:properties/documentManagement/ns2:Category]

    So, what I'd check first is that the "Category" in the CategoryRelationList node actually has matches for the value in your main data source Category field.

    Drag the repeating node from the data source you are using for your Product dropdown onto your form so you can see the data. Drag your main data source Category field onto your form (as a text box) so you can see the value there. Then preview the form - is the value in your main data source Category field the same as what you are seeing in the Category column for the data source you are using for Product.

    Your main data source needs to be populated with a Category ID, it sounds like, from your error. Does the list with Products use a look up for the Category? That is, is that list storing category names or IDs?

    Hilary Stoupa

  • 02-02-2012 11:36 PM In reply to

    Re: Cascade dropdown in DIP (document information panel)

    Hi, Hilary

    Thank you for your answer. I did as you said - drag the repeating node from the data source and drag my main data source Category field onto form (as a text box) and preview it.  Main data source Category field value for first choice ( possible values: Hardware, Software) is 1, repeating node value is  Hardware - so I guess this is the problem.

    If I change Category drop-down box properties from Value:@ID to Value:@Category, then preview shows that values are correct in both nodes, but in main data source Category field I've got a red mark (only positve integers allowed). Yes, I've got lookup. CategoryRelationList has 2 columns (Title, Category) and Category column is lookup in other sharepoint list CategoryType.

            TITLE          CATEGORY

    • Keyboard      Hardware
    • Mouse          Hardware
    • Office            Software
    • Windows       Software

    I'm trying to implement cascade dropdowns in sharepoint document library, so I did it with JQuery & SpServicesCascadeDropdown - I've added some code in editform.aspx (that is the reason why I have 2 lists with lookup). That solves the problem when I upload a document, but not when I create a new document in library, so I've got to solve it with content type and editing DIP with Infopath.

    Regards,

    Klemen 

     

     

  • 02-03-2012 08:26 AM In reply to

    Re: Cascade dropdown in DIP (document information panel)

    So, the XPath for your filter gets a little more complicated, because you have to get the display name for the ID in your main data source category field in order to find the correct products.

    Can you attach your template to a reply, under the Options tab?

    Hilary Stoupa

  • 02-05-2012 10:34 PM In reply to

    Re: Cascade dropdown in DIP (document information panel)

    Hi,

    Here it is.

    Regards,

    Klemen

  • 02-06-2012 07:46 AM In reply to

    Re: Cascade dropdown in DIP (document information panel)

    Currently your Category and Product dropdowns are using the same data source - what data source were you originally using for the Category - I don't see one with fields of ID, Category as outlined in your original post?

    Hilary Stoupa

  • 02-06-2012 11:19 PM In reply to

    Re: Cascade dropdown in DIP (document information panel)

     Hi,   

    I guess I've done several teplates. My data sources:

    CategoryType

           TITLE

    • Hardware
    • Software

    CategoryRelationList

             TITLE          CATEGORY(lookup to TITLE in CategoryType)

    • Keyboard      Hardware
    • Mouse          Hardware
    • Office            Software
    • Windows       Software

    Test (document library where I'm trying to implement cascade dropdown in DIP)

    NAME          KATEGORIJA(lookup to CategoryType)           PRODUCT(lookup to CategoryRelationList)

     

    For KATEGORIJA dropdown I was using  CategoryType data, for PRODUCT dropdown CategoryRelationList. I was also trying with one data source.

    Regards

     

     

     

  • 02-07-2012 08:25 AM In reply to

    Re: Cascade dropdown in DIP (document information panel)

    The filter looks like this in the version I'm attaching:

    /dfs:myFields/dfs:dataFields/dfs:CategoryRelationList[@Category = xdXDocument:GetDOM("CategoryType 2")/dfs:myFields/dfs:dataFields/dfs:CategoryType/@Title[../@ID = xdXDocument:get-DOM()/pr:properties/p:properties/documentManagement/ns2:Kategorija]]

    This is assuming the in the CategoryRelationList, the Category uses the Title rather than the ID for items from the CategoryType.

    Hilary Stoupa

  • 02-09-2012 12:10 AM In reply to

    Re: Cascade dropdown in DIP (document information panel)

    It works!

    Thank you very much :)

    Regards,

    Klemen 

     

  • 06-28-2017 03:50 PM In reply to

    Re: Cascade dropdown in DIP (document information panel)

     Hello Hilary, can we have a cascade column but using only one list as lookup, I am seeing examples but all of them request to have two list. I would like to have one for example. What could be the way to link this into the form.

    Column: Category

    Columb: Subcategory

    Lookup list: 

    Category                 Subcategory

    1                             1.1

    1                              1.2

    2                             2.1

    2                               and so on.

    3

    3

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