SelectText does not work after SwitchView - InfoPath Dev
in

InfoPath Dev

SelectText does not work after SwitchView

Last post 01-14-2010 02:53 AM by Karla. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 01-14-2010 02:53 AM

    • Karla
    • Not Ranked
    • Joined on 12-03-2009
    • Posts 3

    SelectText does not work after SwitchView

    Hallo,

    i have the following problem:

    I developed a form with many fields and several views. One view is for searching values in secondary datasources. After searching for a value into this search view, the user can click a button for selecting a value and for returning to the calling view. All of this works fine, but when i have switched the view, i am at the beginning and not at the position where i started. So i tried to select the Text field, where i have started the search with SelectText, but i get an error at this place. If i use the code directly bound on a button it works.

    Here is  the code (VB)

    Public Sub CTRL95_Clicked(ByVal sender As Object, ByVal e As ClickedEventArgs)

    Dim field As XPathNavigator = Me.CreateNavigator().SelectSingleNode("/my:Daten/my:Artikel/my:Vorratsdaten/my:suno",  Me.NamespaceManager)

    Dim SelectedValue As String = e.Source.SelectSingleNode("T_x0024_SUNO").Value

    field.SetValue(SelectedValue)

    Me.ViewInfos.SwitchView(Me._OldView)

    Me.CurrentView.ForceUpdate()

    CurrentView.SelectText(field)

    End Sub

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