<?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: Changing the selected item in DropDown by Code</title><link>https://www.infopathdev.com:443/forums/thread/7186.aspx</link><pubDate>Fri, 15 Jul 2005 22:05:40 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:7186</guid><dc:creator>Richard</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/7186.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=7186</wfw:commentRss><description>The solution of taking the xsl:if block out , creates another problem:&lt;br /&gt;where , selecting dd1, from P1 to P2, does not fire On_After_Change of the dd2 ! eventhough the display is showing that dd2 has changed.&lt;br /&gt;&lt;br /&gt;</description></item><item><title>Re: Changing the selected item in DropDown by Code</title><link>https://www.infopathdev.com:443/forums/thread/7185.aspx</link><pubDate>Fri, 15 Jul 2005 19:37:26 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:7185</guid><dc:creator>Richard</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/7185.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=7185</wfw:commentRss><description>No,&lt;br /&gt;&lt;br /&gt;After I took the if block , now it is working per my previous post which is acceptable, while your post may suggest that it should not be working..i.e, if the dd1 selection goes from P1 to P2, the dd2 will not display aa( first item in its list) but it does ..&lt;br /&gt;&lt;br /&gt;unless I misunderstood you.</description></item><item><title>Re: Changing the selected item in DropDown by Code</title><link>https://www.infopathdev.com:443/forums/thread/7184.aspx</link><pubDate>Fri, 15 Jul 2005 19:02:32 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:7184</guid><dc:creator>Greg Collins</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/7184.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=7184</wfw:commentRss><description>The kind of thing you are trying to accomplish will require writing custom code to convert "b" to "bb" and back dependingon whether you select P1 or P2.&lt;br /&gt;&lt;br /&gt;The reason it is not working is because dd2 has, lets say, "b" selected when dd1 = P1. When you select P2 in dd1, "b" is STILL the value of dd2. But that value does not exist as an option. You will never get it to suddenly display "bb" because its value is "b". You will need to write code to make that kind of conversion to the value stored in the dd2 field.&lt;br /&gt;&lt;br /&gt;Does that make sense?&lt;br /&gt;&lt;br /&gt;Greg Collins [InfoPath MVP]&lt;br /&gt;InfoPath Dev</description></item><item><title>Re: Changing the selected item in DropDown by Code</title><link>https://www.infopathdev.com:443/forums/thread/7183.aspx</link><pubDate>Thu, 14 Jul 2005 22:41:47 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:7183</guid><dc:creator>Richard</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/7183.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=7183</wfw:commentRss><description>taking the whole xsl:if test solves the problem... i.e all works fine.. however going back and forth in the dd1 selections, one will loose the previously highlighted selections of dd2..&lt;br /&gt;&lt;br /&gt;dd1                          dd2&lt;br /&gt;click on P1 ----&amp;gt;&amp;gt;           shows a&lt;br /&gt;-----------------------&amp;gt;&amp;gt;    click on b , shows b&lt;br /&gt;click on P2 ------------&amp;gt;&amp;gt;   shows aa &lt;br /&gt;-------------------------&amp;gt;&amp;gt;  click on bb&lt;br /&gt;click on P1---------------&amp;gt;&amp;gt; shows a , But it will be nice to show b&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;</description></item><item><title>Re: Changing the selected item in DropDown by Code</title><link>https://www.infopathdev.com:443/forums/thread/7182.aspx</link><pubDate>Thu, 14 Jul 2005 21:56:25 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:7182</guid><dc:creator>Richard</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/7182.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=7182</wfw:commentRss><description>here is the data &lt;br /&gt;&amp;lt;DropDownchoices&amp;gt;&lt;br /&gt;	&amp;lt;choice name="P1"&amp;gt;&lt;br /&gt;		&amp;lt;option name = "a"		url = "1"/&amp;gt;&lt;br /&gt;		&amp;lt;option name = "b" 		url = "2"/&amp;gt;&lt;br /&gt;		&amp;lt;option name = "c" 		url = "3"/&amp;gt;&lt;br /&gt;		&amp;lt;/choice&amp;gt;&lt;br /&gt;	&amp;lt;choice name="P2"&amp;gt;&lt;br /&gt;		&amp;lt;option name = "aa"		url = "11"/&amp;gt;&lt;br /&gt;		&amp;lt;option name = "bb" 		url = "22"/&amp;gt;&lt;br /&gt;		&amp;lt;option name = "cc" 		url = "33"/&amp;gt;&lt;br /&gt;		&amp;lt;/choice&amp;gt;&lt;br /&gt;&amp;lt;/DropDownChoices&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; dd1 and dd2 are in repeating table :&lt;br /&gt;For dd1 :&lt;br /&gt;name=ChoiceName  entry = /DropDownchoices/choice/@name value = . dispaly = .   (xsl left alone)&lt;br /&gt;&lt;br /&gt;For dd2&lt;br /&gt;name=OptionName , I created a dropdown with entry=/DropDownchoices/choice/option value=@url display=@name and later modified to xd:preserve and did the changes to xsl for apply template.&lt;br /&gt;I took the empty &amp;lt;option/&amp;gt; out.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;gt;&amp;gt;What do you mean when you say "the next dd1 selection"? In this the &amp;gt;&amp;gt;same dd list or in a different one in a separate repeating &amp;gt;&amp;gt;table/section row?&lt;br /&gt;&lt;br /&gt;in preview of the table, you see 1 row, with dd1 and dd2, if you click on dd1 and highlight it for P1 , you see dd2 populated with a, b, c and a is selected. ( I have taken out the empty option ).&lt;br /&gt;&lt;br /&gt;Now, you highlight P2 in dd1, and you see that dd2 has empty field selected..?? instead of picking aa.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;</description></item><item><title>Re: Changing the selected item in DropDown by Code</title><link>https://www.infopathdev.com:443/forums/thread/7181.aspx</link><pubDate>Thu, 14 Jul 2005 21:06:24 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:7181</guid><dc:creator>Greg Collins</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/7181.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=7181</wfw:commentRss><description>Richard, I don't follow exactly what you are doing. Is the cascading list in a repeating table/section?&lt;br /&gt;&lt;br /&gt;What do you mean when you say "the next dd1 selection"? In this the same dd list or in a different one in a separate repeating table/section row?&lt;br /&gt;&lt;br /&gt;Is the list populating... but also has a blank option? Or it is nothing but a blank option?&lt;br /&gt;&lt;br /&gt;Greg Collins [InfoPath MVP]&lt;br /&gt;InfoPath Dev</description></item><item><title>Re: Changing the selected item in DropDown by Code</title><link>https://www.infopathdev.com:443/forums/thread/7180.aspx</link><pubDate>Thu, 14 Jul 2005 20:36:22 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:7180</guid><dc:creator>Patrick Halstead</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/7180.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=7180</wfw:commentRss><description>Hi Richard,&lt;br /&gt;I'll ask Greg to respond to this. More soon,&lt;br /&gt;&lt;br /&gt;Patrick Halstead [InfoPath MVP]&lt;br /&gt;InfoPathDev</description></item><item><title>Re: Changing the selected item in DropDown by Code</title><link>https://www.infopathdev.com:443/forums/thread/7179.aspx</link><pubDate>Thu, 14 Jul 2005 20:11:58 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:7179</guid><dc:creator>Richard</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/7179.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=7179</wfw:commentRss><description>Hi Patrick ,&lt;br /&gt;&lt;br /&gt;I must have a custom control with other requirements, but in the mean time, trying to unleash the cascade in the repeating table using xsl which works for the most part. except:&lt;br /&gt;&lt;br /&gt;1-I have taken the &amp;lt;option/&amp;gt; out, so the list will have no blank item.&lt;br /&gt;2- dd2 selections works correctly for the first dd1 selection&lt;br /&gt;However, with the next dd1 selection , an empty item in the dd2 list appears, i.e goes throught the following section of the template which I chose different color for:&lt;br /&gt;&lt;br /&gt;dd1: my:ChoiceName value=choice/@name       display=choice/@name&lt;br /&gt;dd2: my:OptionName value=choice/option/@url  display=choice/option/@name&lt;br /&gt;&lt;br /&gt;-----------------------------&lt;br /&gt;&amp;lt;xsl:variable name="val" select="."&amp;gt;&amp;lt;/xsl:variable&amp;gt;&lt;br /&gt;&amp;lt;xsl:variable name="Chn" select="../my:ChoiceName"&amp;gt;&amp;lt;/xsl:variable&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;xsl:if test="not(xdXDocument:GetDOM(&amp;quot;choices&amp;quot;)/DropDownchoices/choice[@name = $Chn]/option[@url=$val] or $val='' )"&amp;gt;&lt;br /&gt;&amp;lt;option selected="selected" style="BACKGROUND-COLOR: #ffff22"&amp;gt;&lt;br /&gt;&amp;lt;xsl:attribute name="value"&amp;gt;&lt;br /&gt;&amp;lt;xsl:value-of select="$val"&amp;gt;&amp;lt;/xsl:value-of&amp;gt;&lt;br /&gt;&amp;lt;/xsl:attribute&amp;gt;&lt;br /&gt;&amp;lt;xsl:value-of select="$val/@name"&amp;gt;&amp;lt;/xsl:value-of&amp;gt;&lt;br /&gt;&amp;lt;/option&amp;gt;&lt;br /&gt;&amp;lt;/xsl:if&amp;gt;&lt;br /&gt;&lt;br /&gt;</description></item><item><title>Re: Changing the selected item in DropDown by Code</title><link>https://www.infopathdev.com:443/forums/thread/7178.aspx</link><pubDate>Thu, 14 Jul 2005 02:25:30 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:7178</guid><dc:creator>Patrick Halstead</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/7178.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=7178</wfw:commentRss><description>Hi Richard,&lt;br /&gt;&lt;br /&gt;1 - yes, just set the value of the node. You don't need code though. You can use a rule to do this or call out to xdExtension from the default value function. &lt;br /&gt;&lt;br /&gt;2 - just a default I think. If it wasn't the first item in the list what would it be?&lt;br /&gt;&lt;br /&gt;Have you seen our Smart Combo Box? Check it out:&lt;a target="_blank" href=http://www.infopathdev.com/webstore/detail.aspx?itemid=14&gt;http://www.infopathdev.com/webstore/detail.aspx?itemid=14&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Patrick Halstead [InfoPath MVP]&lt;br /&gt;InfoPathDev</description></item><item><title>Changing the selected item in DropDown by Code</title><link>https://www.infopathdev.com:443/forums/thread/4782.aspx</link><pubDate>Thu, 14 Jul 2005 01:36:06 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:4782</guid><dc:creator>Richard</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/4782.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=4782</wfw:commentRss><description>2 questions:&lt;br /&gt;&lt;br /&gt;1- Is there a way to change the selected item in the DropDown by code ??&lt;br /&gt;I query the dataconnection that the dropdown is bound to via C# code, &lt;br /&gt;in addition, I want to set the selected item for this dropdown via C# code .&lt;br /&gt;&lt;br /&gt;2- The standard behaviour of the dropdown is to have selected on the item whose value is 0 ..  What is the idea behind this ??&lt;br /&gt;&lt;br /&gt;</description></item></channel></rss>