Open Hyperlink in the same window - InfoPath Dev
in

InfoPath Dev

Open Hyperlink in the same window

Last post 10-19-2013 01:44 PM by RohanRao. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 10-15-2013 11:38 AM

    Open Hyperlink in the same window

    I have an infopath form which has two views

     - Create Request
     - List of all submitted Forms
    I am getting the second view with the help of a secondary dataconnection to the SharePoint submit library and using a repeating table to show the details.

    To open any existing form that was submitted i have created a hyperlink field
    (Insert > Hyperlink selected the URL field and the Title field from the dataconnection)
    in repeating table when clicked opens the form, everything works prefect but my only problem is the form opens up in a new window is there way to open the form in the same window.

    Tried Changing the View.xsl

        <a onclick="BLOCKED SCRIPTNewItem2(event,'');return false;" target="_self">   
        <xsl:attribute name="href">
        <xsl:value-of select="d:URL"/>
        </xsl:attribute>title </a>

    above example opens the link in the same page but the link is not populated the right way because the removed `class="xdDataBindingUI" xd:disableEditing="yes"` from the hyperlink anchor tag.

        <a onclick="BLOCKED SCRIPTNewItem2(event,'');return false;" target="_self" class="xdDataBindingUI" xd:disableEditing="yes">   
            <xsl:attribute name="href">
            <xsl:value-of select="d:URL"/>
            </xsl:attribute>title </a>
    When i include the class the URL is populated correctly but its opening in a new window rather than the same window.

    Let me know if there is a better approach.

  • 10-19-2013 12:09 PM In reply to

    Re: Open Hyperlink in the same window

    Well, the link can open the form in a separate window - that's easy and out of box.

    You can make the link a button that queries the Library to get the XML into a secondary data source and then you can use one of two techniques to copy the data into your main data source:

    • Rules - just copy each field
    • qRules SwapDom - copy all fields with one command (requires injection of qRules plugin)

    Then you would just submit over the existing form.

    No need to hack the XSLT.

    Patrick Halstead
    Project Manager at Qdabra
  • 10-19-2013 01:44 PM In reply to

    Re: Open Hyperlink in the same window

    Thanks Patrick for your reply.

    Yes i have started my work yes you have proposed used the below code on the button on Click event. 

    XPathNavigator nav = e.Source.CreateNavigator();

    String a = nav.SelectSingleNode("my:URL", NamespaceManager).Value;

    HttpContext.Current.Response.Redirect(a, false);

    I have couple of questions

    1.This works in firefox and chrome but not in IE9. In IE it shows the form is loading but when i manually refreh the page the form loads up.

    2.Is the above code good practice.

    3.After the redirect the back button doesnt work as its suppose to, it doesn't take me back to the page where i have clicked the button for redirection.

    -Rohan

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