Picture Control and Linking - InfoPath Dev
in

InfoPath Dev

Picture Control and Linking

Last post 05-08-2005 01:53 PM by Agni Jonnalagadda. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 05-06-2005 01:46 PM

    • Idisis
    • Not Ranked
    • Joined on 04-28-2005
    • Posts 5

    Picture Control and Linking

    Hello All,

    I am almost done my project (thank god and of course some of you). The last thing I need to be able to do is read a image link from our sharepoint site and have it display in the form. Unfortunatly this picture has to be dynamic, allow me to elaborate:

    On the sharepoint site is a list that houses the following columns (Component, Version, and Image_Link). The Component performs a lookup on my components list, version is free form and Image_Link is a link that points to a picture on the web (within our sharepoint site in this case).

    Inside of InfoPath I have setup a data connection called 'Component Images'. This data conenction links to the list above. I have also placed a picture control onto the form and assigned it the 'Link to' value. Inside the XPath of the picture control (named Image) is the following:

    xdXDocument:GetDOM("Component Images")/dfs:myFields/dfs:dataFields/dfs:Component_Images[@Version = "2.00" and @Component = "Building Select"]/@Image_Link.

    As you can see I have hardcoded the @Version and @Component values which works fine (it is displaying the picture for the 'Building Select' component of version '2.00'). The problem here is I want this to be dynamic. "2.00" should be the name of my version control (my:version) and "Building Select" should be the name of my component control (my:comp_name).

    I have tried the following and several variations, but I cannot figure out what I am doing wrong:

    xdXDocument:GetDOM("Component Images")/dfs:myFields/dfs:dataFields/dfs:Component_Images[@Version = //my:version and @Component = //my:comp_name]/@Image_Link.

    xdXDocument:GetDOM("Component Images")/dfs:myFields/dfs:dataFields/dfs:Component_Images[@Version = my:version and @Component = my:comp_name]/@Image_Link.


    Any help would be greatly appreciated,
    Thanks,
    Ryan
  • 05-08-2005 01:53 PM In reply to

    Re: Picture Control and Linking

    Hi Ryan,
    You have specified an xpath to look for in the filter, but you did not specify from which Dom you want the data to be picked up.
    So I think your xpath should be,
    xdXDocument:GetDOM("Component Images")/dfs:myFields/dfs:dataFields/dfs:Component_Images[@Version =
    xdXDocument:get-DOM()/my:myFields/my:version and @Component =
    xdXDocument:get-DOM()/my:myFields/my:comp_name]/@Image_Link

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