<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>General</title><link>https://www.infopathdev.com:443/forums/41.aspx</link><description>If you're not sure where to ask your question, ask it here. If necessary, our moderators will make sure it gets classified in the correct board.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Button OnClick Event</title><link>https://www.infopathdev.com:443/forums/thread/7729.aspx</link><pubDate>Mon, 26 Feb 2007 07:34:03 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:7729</guid><dc:creator>Shiva</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/7729.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=7729</wfw:commentRss><description>Hi Bill,&lt;br /&gt;&lt;br /&gt;You have to check the ‘objectField1#%92 node is getting or not before set the focus. If you are getting the node then below the syntax is correct to set focus this filed. One more is the textbox should not be read only as per mcjack.</description></item><item><title>Re: Button OnClick Event</title><link>https://www.infopathdev.com:443/forums/thread/7728.aspx</link><pubDate>Wed, 21 Feb 2007 20:18:58 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:7728</guid><dc:creator>Bill </dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/7728.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=7728</wfw:commentRss><description>Hello,&lt;br /&gt;&lt;br /&gt;I am having a similar issue when attempting to set the focus to a check box:  I run this code (written in VB) in an afterUpdate event:&lt;br /&gt;&lt;br /&gt;Dim objectField1 = e.Xdocument.DOM.selectsingleNode("/dfs:myFields/dfs:datafields/d:AForm49B/@Gender")&lt;br /&gt;&lt;br /&gt;e.xDocument.View.SelectText(objField1, Type.Missing)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;and I receive this error:&lt;br /&gt;&lt;br /&gt;The specified values for the View.SelectText call are not valid.&lt;br /&gt;   at Microsoft.Office.Interop.InfoPath.SemiTrust.View.SelectText(IXMLDOMNode pxnField, Object varViewContext)&lt;br /&gt;   at Microsoft.Office.Interop.InfoPath.SemiTrust.ViewObjectWrapper.SelectText(IXMLDOMNode pxnField, Object varViewContext)&lt;br /&gt;   at DHS49B.DHS49B.CTRL7_OnClick(DocActionEvent e) in E:\goldmine\GMForms\DHS49Forms\DHS49Forms\DHS49B\DHS49B\FormCode.vb:line 752&lt;br /&gt;   at Microsoft.Office.Interop.InfoPath.SemiTrust._ButtonEventSink_SinkHelper.OnClick(DocActionEvent pEvent)&lt;br /&gt;&lt;br /&gt;Can anyone tell me what I am doing wrong?&lt;br /&gt;&lt;br /&gt;Thanks!&lt;br /&gt;&lt;br /&gt;Bill</description></item><item><title>Re: Button OnClick Event</title><link>https://www.infopathdev.com:443/forums/thread/7727.aspx</link><pubDate>Wed, 05 Oct 2005 07:56:25 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:7727</guid><dc:creator>gaikwadsantosh</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/7727.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=7727</wfw:commentRss><description>check your xpath properly &lt;br /&gt;&lt;br /&gt;IXMLDOMNode nodeAna = thisXDocument.DOM.selectSingleNode ("my:myFields/my:DatiAnagrafici/my:DatiAnagraficiLab");&lt;br /&gt;&lt;br /&gt;</description></item><item><title>Re: Button OnClick Event</title><link>https://www.infopathdev.com:443/forums/thread/7726.aspx</link><pubDate>Fri, 23 Sep 2005 10:40:26 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:7726</guid><dc:creator>mcjack</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/7726.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=7726</wfw:commentRss><description>Hi all,&lt;br /&gt;I've found the problem.&lt;br /&gt;here the solution: the textbox mustn't be read only.&lt;br /&gt;&lt;br /&gt;Regards</description></item><item><title>Re: Button OnClick Event</title><link>https://www.infopathdev.com:443/forums/thread/7725.aspx</link><pubDate>Thu, 22 Sep 2005 07:37:34 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:7725</guid><dc:creator>mcjack</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/7725.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=7725</wfw:commentRss><description>Hi,&lt;br /&gt;&lt;br /&gt;here is my code (C#.net):&lt;br /&gt;public void CTRL81_5_OnClick(DocActionEvent e)&lt;br /&gt;{&lt;br /&gt; // Write your code here.&lt;br /&gt; IXMLDOMNode nodeAna = thisXDocument.DOM.selectSingleNode ("my:myFields/my:DatiAnagrafici/my:DatiAnagraficiLab");&lt;br /&gt;thisXDocument.View.SelectText(nodeAna, Type.Missing);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;and this the error I get&lt;br /&gt;&lt;br /&gt;System.Runtime.InteropServices.COMException&lt;br /&gt;The specified values for the View.SelectText call are not valid.&lt;br /&gt;at Microsoft.Office.Interop.InfoPath.SemiTrust.View.SelectText(IXMLDOMNode pxnField, Object varViewContext)&lt;br /&gt;at Microsoft.Office.Interop.InfoPath.SemiTrust.ViewObjectWrapper.SelectText(IXMLDOMNode pxnField, Object varViewContext)&lt;br /&gt;at Microsoft.Office.Interop.InfoPath.SemiTrust.ViewObjectWrapper.SelectText(IXMLDOMNode pxnField, Object varViewContext)&lt;br /&gt;at InfoPathProject2.InfoPathProject2.CTRL81_5_OnClick(DocActionEvent e) &lt;br /&gt;in c:\documents and settings\u010101275\my documents\italcementi\myvisualstudioprojects\infopathproject2\infopathproject2\formcode.cs:line 38&lt;br /&gt;&lt;br /&gt;Can you hel me?&lt;br /&gt;Thanks</description></item><item><title>Re: Button OnClick Event</title><link>https://www.infopathdev.com:443/forums/thread/7724.aspx</link><pubDate>Wed, 21 Sep 2005 13:47:51 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:7724</guid><dc:creator>bratt</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/7724.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=7724</wfw:commentRss><description>use "Type.Missing" for the second parameter:&lt;br /&gt;VB.net:&lt;br /&gt;thisXDocument.View.SelectText(Node, Type.Missing)</description></item><item><title>Re: Button OnClick Event</title><link>https://www.infopathdev.com:443/forums/thread/7723.aspx</link><pubDate>Wed, 21 Sep 2005 12:43:58 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:7723</guid><dc:creator>mcjack</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/7723.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=7723</wfw:commentRss><description>Hi,&lt;br /&gt;&lt;br /&gt;I've this problem: the function View.SelectText requires two parameters a node and a varViewContext which is the ID of the control that is used for the context, which is an element with the specified view context of xd:CtrlId, otherwise it gives me an error.</description></item><item><title>Re: Button OnClick Event</title><link>https://www.infopathdev.com:443/forums/thread/7722.aspx</link><pubDate>Wed, 21 Sep 2005 12:16:25 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:7722</guid><dc:creator>vt_asparagus</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/7722.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=7722</wfw:commentRss><description>Check out this chain -&lt;a target="_blank" href=http://www.infopathdev.com/forums/topic.asp?TOPIC_ID=810&gt;http://www.infopathdev.com/forums/topic.asp?TOPIC_ID=810&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;In InfoPath there is no typical focus() method to call.  You have to select the correct node in the DOM.</description></item><item><title>Button OnClick Event</title><link>https://www.infopathdev.com:443/forums/thread/4927.aspx</link><pubDate>Wed, 21 Sep 2005 09:01:02 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:4927</guid><dc:creator>mcjack</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/4927.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=4927</wfw:commentRss><description>Hi all,&lt;br /&gt;&lt;br /&gt;I need to move focus to a textBox on button click event using c#.&lt;br /&gt;&lt;br /&gt;Thanks.&lt;br /&gt;&lt;br /&gt;mcjack</description></item></channel></rss>