<?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>Newbie Questions</title><link>https://www.infopathdev.com:443/forums/39.aspx</link><description>New to InfoPath? Search to see if your question has already been answered. If it has not, then ask it here or the appropriate topic forum.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Repeating Table to show or hide a section</title><link>https://www.infopathdev.com:443/forums/thread/19881.aspx</link><pubDate>Tue, 15 May 2007 01:59:42 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:19881</guid><dc:creator>Soham Bhatt</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/19881.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=19881</wfw:commentRss><description>Hi Matt,&lt;br&gt;&lt;br&gt;

Thanks for the help again - all works fine except 1 small thing.&lt;br&gt;&lt;br&gt;

My hotel details are in a repeating section - it has 1st column as a drop down for states from an XML doc (see below) and 2 column is a drop down for Hotels in that state from 1st colum within the same xml doc. It all works fine in the same repeating section after i filter the data in hotel drop down - i''m using cascading drop downs&lt;br&gt;&lt;br&gt;

But if i insert another hotel detail (repeating section) - the hotel drop down still contains/uses the value from the previous selected repeating hotel detail.&lt;br&gt;&lt;br&gt;

i have also made a rule for the 1st column to check if the value of its field is not equal to the value in xml.&lt;br&gt;&lt;br&gt;

What am i missing here?&lt;br&gt;&lt;br&gt;


sample xml: (having trouble pasting the xml - it strips all the tags out)&lt;br&gt;&lt;br&gt;
HotelList&lt;br&gt;
	HotelCity value="Adelaide"&lt;br&gt;
		Oaks Horizons&lt;br&gt;		
Oaks Pier Plaza&lt;br&gt;
HotelCity value="Brisbane"&lt;br&gt;	Marriott&lt;br&gt;
		Stamford Grand</description></item><item><title>Re: Repeating Table to show or hide a section</title><link>https://www.infopathdev.com:443/forums/thread/19659.aspx</link><pubDate>Tue, 08 May 2007 05:39:56 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:19659</guid><dc:creator>Matt Faus</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/19659.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=19659</wfw:commentRss><description>&lt;p&gt;Hi Soham,&lt;/p&gt;&lt;p&gt;For Case 1, you will put conditional formatting on the Car Details section that uses THE EXPRESSION = &amp;quot;not(/myfields/Trip/Legs/Leg[ car = &amp;#39;yes&amp;#39; ])&amp;quot; as the condition, HIDE as the action.&amp;nbsp; This expression checks for the existance of a node, and then negates it.&amp;nbsp; Therefore, if there are zero car checks, then that returns false, which is negated to true, and then hides the section.&amp;nbsp; Conditional formatting is backwards thinking like that.&lt;/p&gt;&lt;p&gt;For Case 2, I suggest that you make this an optional section within the Leg group given in the XPath above, so that the user will click &amp;quot;Insert Hotel Details&amp;quot; instead of having to check a checkbox and then go to a different part of the form to fill in Hotel Details.&amp;nbsp; However, if you really want them to be seperate, you will still use a Hotel group within the Leg group, but you will have another instance of the Leg repeating table, but this one will have a Data Filter (double-click the repeating table, and go to Display tab).&amp;nbsp; The filter will be where hotelCheckBox = &amp;#39;true&amp;#39;.&lt;/p&gt;&lt;p&gt;&amp;nbsp;Hope this helps, good luck!&lt;/p&gt;</description></item><item><title>Re: Repeating Table to show or hide a section</title><link>https://www.infopathdev.com:443/forums/thread/19651.aspx</link><pubDate>Mon, 07 May 2007 23:48:53 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:19651</guid><dc:creator>Soham Bhatt</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/19651.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=19651</wfw:commentRss><description>Thanks Matt and Nukkumatti. I was exactly after the xpath [and also  current() and position()] functions to get the results but didn’t the know the way to do it.&lt;br&gt;&lt;br&gt;

I will try and explain the situation in a better way possible:&lt;br&gt;&lt;br&gt;

With my Repeating Table I have 4 columns (departure city, arrival city, hotel and car). With hotel and car I have a drop down option of "Yes" and "No".
&lt;br&gt;&lt;br&gt;
Assuming person who fills the form may travel to multiple city hence they can insert more rows and choose the options. &lt;br&gt;&lt;br&gt;

Case I
&lt;br&gt;&lt;br&gt;
If any row(s) in the repeating table have car option selected "Yes" - a new section (Car Details - non repeating) outside the repeating table appears (until then it was hidden) for user to fill in the details.
&lt;br&gt;&lt;br&gt;
Case II
&lt;br&gt;&lt;br&gt;
If any rows in the repeating table have the Hotel option selected to "yes" a new Repeating table (in a section or just by itself) called Hotel Details is shown (until then it was hidden). The new repeating table/section should have the same number of rows based on the "yes" selected in the previous repeating section. e.g. a person travel 3 trips have 2 rows with hotel selected as "yes" - then the Hotel Details repeating/table section should also show 2 rows.
&lt;br&gt;&lt;br&gt;
Hope this is clear and direct - please provide the steps if possible on how to achieve results for above scenarios.
&lt;br&gt;&lt;br&gt;
Thanks again Guys</description></item><item><title>Re: Repeating Table to show or hide a section</title><link>https://www.infopathdev.com:443/forums/thread/19628.aspx</link><pubDate>Mon, 07 May 2007 13:25:03 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:19628</guid><dc:creator>nukkumatti</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/19628.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=19628</wfw:commentRss><description>&lt;p&gt;Doh ! Yes Matt is right his proposal should be easier to implement than mine. Sometimes you just don&amp;#39;t think about the simple things. Thx Matt for jumping in.&lt;/p&gt;</description></item><item><title>Re: Repeating Table to show or hide a section</title><link>https://www.infopathdev.com:443/forums/thread/19624.aspx</link><pubDate>Mon, 07 May 2007 13:07:12 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:19624</guid><dc:creator>Matt Faus</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/19624.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=19624</wfw:commentRss><description>Hi Soham,
&lt;br /&gt;&lt;br /&gt;
I really don't think you need to be using code in this situation.  I think what happens is that you are always comparing to the first row of the repeating table.  You need to make use of the current() or position() xpath functions.  Is the section outside of the first repeating section also repeating? If so, you should compare where position() = current()/position().  If it's not repeating, then you will just look for the existance of ANY node with the value of yes.

&lt;br /&gt;&lt;br /&gt;Or a better idea might be to use a master/detail table, and then sort the detail table to only show those that have the "yes" value.
&lt;br /&gt; &lt;br /&gt; Either way, please explain the situation a little better so we can provide better support.</description></item><item><title>Re: Repeating Table to show or hide a section</title><link>https://www.infopathdev.com:443/forums/thread/19618.aspx</link><pubDate>Mon, 07 May 2007 11:35:44 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:19618</guid><dc:creator>nukkumatti</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/19618.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=19618</wfw:commentRss><description>&lt;p&gt;Hi soham,&lt;/p&gt;&lt;p&gt;hope I understand your requirement correctly. I guess you have to use code to accomplish what you want. Try the following:&lt;/p&gt;&lt;p&gt;Add a new text field on your from name it &amp;quot;flag&amp;quot; for example. Use this field for conditional formatting for your new section outside your repeating section. Set the condition to &amp;quot;If flag is not equal to show&amp;quot; then hide this control and delete the conditional formatting you used before. Now double click your dropdown within your repeating section, click data validation, select onafterchange event and click edit code. within your onafterchange use code similar to the one below (jscript):&lt;/p&gt;&lt;code&gt;&lt;p&gt;if(eventObj.Site.selectSingleNode(&amp;quot;../my:NameOfYourDropDownList&amp;quot;).text == &amp;quot;Yes&amp;quot;)&lt;/p&gt;&lt;p&gt;{&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; XDocument.DOM.selectSingleNode(&amp;quot;my:myFields/my:flag&amp;quot;).text = &amp;quot;show&amp;quot;&lt;/p&gt;&lt;p&gt;}&lt;/p&gt;&lt;p&gt;else&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; XDocument.DOM.selectSingleNode(&amp;quot;my:myFields/my:flag&amp;quot;).text = &amp;quot;&amp;quot;&lt;/p&gt;&lt;/code&gt;&lt;p&gt;Let me know if this helps.&lt;/p&gt;</description></item><item><title>Repeating Table to show or hide a section</title><link>https://www.infopathdev.com:443/forums/thread/19612.aspx</link><pubDate>Mon, 07 May 2007 07:01:42 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:19612</guid><dc:creator>Soham Bhatt</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/19612.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=19612</wfw:commentRss><description>I have got a repeating table to get the user input on various fields. one of the field have an option (dropdown) with values "yes" &amp; "no".

If the user select yes a new section outside the repeating table is shown and if they select no the new section its hidden.

It all works fine with first row of the repeating table selected yes. But if i insert any other rows with 1 selected "no"- the section still remains hidden.

How can i make it such a way that it only checks one 1 row that is selected yes for which i get to see the section.</description></item></channel></rss>