<?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>Code</title><link>https://www.infopathdev.com:443/forums/45.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: jscript to update background color in repeating table</title><link>https://www.infopathdev.com:443/forums/thread/22333.aspx</link><pubDate>Tue, 14 Aug 2007 19:42:12 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:22333</guid><dc:creator>Kathryn Bates</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/22333.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=22333</wfw:commentRss><description>&lt;p&gt;Clay,&amp;nbsp;You were right about my needing to have a key piece of data in each row for completing the formatting process.&amp;nbsp; While I needed the formatting information to come from the list box originally, I needed to find a way to retain the the color that was used for each item in the list box also.&amp;nbsp; I ended up adding an extra field to the repeating table to hold the key piece of data regarding the color formatting.&amp;nbsp; I made the field hidden and then I set the value of it in the jscript&amp;nbsp;code based on the selection choice&amp;nbsp;the user makes&amp;nbsp;from the listbox.&amp;nbsp; By doing it that way, the next time a selection is made from the list box it only updates the current&amp;nbsp;row being added and none of the rows that were added previously. As a result any row that was added before is able to retain the previous formatting because the value of the new hidden field does not change.&amp;nbsp; &lt;/p&gt;&lt;p&gt;By the way, originally when I asked the question I wasn&amp;#39;t sure if there was a way to read color formatting information in to a variable in my jscript code or not.&amp;nbsp; Just as I can read in text contained in a control, I thought there might be something available to read in what color formatting that was used.&amp;nbsp; If you do know of a way to do that, I would update my code to do it that way, but at least for now I have something working.&amp;nbsp; Thanks again, I appreciate all of your&amp;nbsp;help!&lt;/p&gt;</description></item><item><title>Re: jscript to update background color in repeating table</title><link>https://www.infopathdev.com:443/forums/thread/22303.aspx</link><pubDate>Mon, 13 Aug 2007 14:34:28 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:22303</guid><dc:creator>Clay Fox</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/22303.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=22303</wfw:commentRss><description>&lt;p&gt;I think your issue is where you are looking for your formatting.&lt;/p&gt;&lt;p&gt;You currently have your conditional format looking at the list box, really you want it to look at each row to decide the color.&amp;nbsp; Hopefully the key peice of data is in each row in your repeating table, if not you would need to add it&amp;nbsp;because then each row will color correctly.&lt;/p&gt;&lt;p&gt;So list box would have x,y,z,a,b&lt;/p&gt;&lt;p&gt;Your repeating rows would have the x,y,z,a,b column in it and it would look to the row field for the color logic.&lt;/p&gt;&lt;p&gt;Hope this helps.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: jscript to update background color in repeating table</title><link>https://www.infopathdev.com:443/forums/thread/22278.aspx</link><pubDate>Fri, 10 Aug 2007 14:23:51 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:22278</guid><dc:creator>Kathryn Bates</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/22278.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=22278</wfw:commentRss><description>&lt;p&gt;Hi Clay,&amp;nbsp; Thank you for your response.&amp;nbsp; &lt;/p&gt;&lt;p&gt;I do have my fields in the repeating table set up with conditional formatting.&amp;nbsp; The conditional formatting is set up to change color depending upon what the user has&amp;nbsp;chosen form the list box.&amp;nbsp; The problem (which I may not be evident from what I wrote before) ends up being that it changes all of the rows in the table each time a selection from the list box is made. I want to retain the color formatting in each row as the rows are added to the repeating table.&lt;/p&gt;&lt;p&gt;For example, say the list box has the values 1, 2 and 3. And the repeating table fields have conditional formatting&amp;nbsp;based on&amp;nbsp;each of the values - if the user chooses 1 the color is blue, if the user choose 2 is is yellow and if the user chooses 3 it is green.&amp;nbsp;&amp;nbsp;The user selects from &amp;#39;1&amp;#39; from the list box, a new row entry is inserted into the repeating table and it is given a blue color based the selected value from the listbox.&amp;nbsp; The user selects 2 from the listbox next and another row entry is inserted into the repeating table and it is given a yellow color based the selected value from the listbox, but the row entry from the first selection also becomes yellow too.&amp;nbsp; I want the first entry to retain the blue color and was hoping to find a way to do that.&amp;nbsp; I didn&amp;#39;t see a clear way to do it, so I thought prehaps it could be done programmatically. Do you know if it is possible to do what I described or not? &lt;/p&gt;</description></item><item><title>Re: jscript to update background color in repeating table</title><link>https://www.infopathdev.com:443/forums/thread/22276.aspx</link><pubDate>Fri, 10 Aug 2007 13:28:16 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:22276</guid><dc:creator>Clay Fox</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/22276.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=22276</wfw:commentRss><description>I am not sure with code but you can just use the conditional formating in InfoPath on the repeating table.&amp;nbsp; Set up your conditions either based on values or related to your list box values.&amp;nbsp; Why do you need to use code when the built in functionality is available?</description></item><item><title>jscript to update background color in repeating table</title><link>https://www.infopathdev.com:443/forums/thread/22270.aspx</link><pubDate>Thu, 09 Aug 2007 20:12:42 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:22270</guid><dc:creator>Kathryn Bates</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/22270.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=22270</wfw:commentRss><description>&lt;p class="MsoNormal" style="margin:0in 0in 0pt;"&gt;&lt;font face="Times New Roman" size="3"&gt;I currently have an InfoPath 2003 form that pulls in data from a secondary data source through the use of a list box.&lt;span&gt;&amp;nbsp; &lt;/span&gt;The form is set up so that the form user can select items from the list box by hitting a button for each selection.&lt;span&gt;&amp;nbsp; &lt;/span&gt;As each selection is made there is a repeating table on the form that gets populated programmatically row by row.&lt;span&gt;&amp;nbsp; &lt;/span&gt;I have this part mostly working fine.&lt;span&gt;&amp;nbsp; &lt;/span&gt;However, I am missing &lt;/font&gt;&lt;a name="OLE_LINK4"&gt;&lt;/a&gt;&lt;a name="OLE_LINK3"&gt;&lt;/a&gt;&lt;span&gt;&lt;font face="Times New Roman" size="3"&gt;the ability to add some conditional formatting.&lt;/font&gt;&lt;/span&gt;&lt;font size="3"&gt;&lt;font face="Times New Roman"&gt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;Based on the list box values, I want to change the background color of each row in the repeating table as they are added programmatically. Each different choice could have a different color that is associated with it and the desired resulting table may end up with many colors.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;"&gt;&lt;font face="Times New Roman" size="3"&gt;&amp;nbsp;&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;"&gt;&lt;font size="3"&gt;&lt;font face="Times New Roman"&gt;Below is the current jscript code for the button that is working minus the background color formatting.&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;"&gt;&lt;font face="Times New Roman" size="3"&gt;&amp;nbsp;&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;"&gt;&lt;font face="Times New Roman" size="3"&gt;function CTRL5_5::OnClick(eventObj) {&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;"&gt;&lt;font face="Times New Roman" size="3"&gt;&amp;nbsp;&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;"&gt;&lt;font size="3"&gt;&lt;font face="Times New Roman"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;// each tine the button is selected a new row is added to the repeating table for the &lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;principle selected.&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;a name="OLE_LINK2"&gt;&lt;/a&gt;&lt;a name="OLE_LINK1"&gt;&lt;/a&gt;&lt;span&gt;&lt;font face="Times New Roman" size="3"&gt;The text is updated to match the text from the drop down&lt;/font&gt;&lt;/span&gt;&lt;font face="Times New Roman" size="3"&gt;.&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;"&gt;&lt;font face="Times New Roman" size="3"&gt;&amp;nbsp;&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;"&gt;&lt;font size="3"&gt;&lt;font face="Times New Roman"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;var parent = XDocument.DOM.selectSingleNode(&amp;quot;/my:myFields/my:group4&amp;quot;); &lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;"&gt;&lt;font size="3"&gt;&lt;font face="Times New Roman"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;var rowOne = parent.selectSingleNode(&amp;quot;./my:group5&amp;quot;); &lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;"&gt;&lt;font size="3"&gt;&lt;font face="Times New Roman"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;var rowClone = rowOne.cloneNode(true); &lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;"&gt;&lt;font face="Times New Roman" size="3"&gt;&amp;nbsp;&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;"&gt;&lt;font size="3"&gt;&lt;font face="Times New Roman"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;var f9 = rowClone.selectSingleNode(&amp;quot;my:principleSelected&amp;quot;); &lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;"&gt;&lt;font size="3"&gt;&lt;font face="Times New Roman"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;var principleVal = eventObj.Source.selectSingleNode(&amp;quot;//my:principlesLB&amp;quot;).text; &lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;"&gt;&lt;font face="Times New Roman" size="3"&gt;&amp;nbsp;&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;"&gt;&lt;font size="3"&gt;&lt;font face="Times New Roman"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;// The text is updated to match the text from the drop down&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;"&gt;&lt;font size="3"&gt;&lt;font face="Times New Roman"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;f9.text = principleVal parent.appendChild(rowClone); &lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;"&gt;&lt;font face="Times New Roman" size="3"&gt;&amp;nbsp;&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;"&gt;&lt;font size="3"&gt;&lt;font face="Times New Roman"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;// the starting sample row is removed &lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;"&gt;&lt;font size="3"&gt;&lt;font face="Times New Roman"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;var ss = rowOne.text.substr(4, 6); &lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;"&gt;&lt;font size="3"&gt;&lt;font face="Times New Roman"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;if (ss == &amp;quot;Sample&amp;quot;) {&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;"&gt;&lt;font size="3"&gt;&lt;font face="Times New Roman"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;parent.removeChild(rowOne);&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;"&gt;&lt;font size="3"&gt;&lt;font face="Times New Roman"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;} &lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;"&gt;&lt;font face="Times New Roman" size="3"&gt;}&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;"&gt;&lt;font face="Times New Roman" size="3"&gt;&amp;nbsp;&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;"&gt;&lt;font face="Times New Roman" size="3"&gt;If anyone knows how or if I can add the ability to add some conditional formatting for &lt;/font&gt;&lt;a name="OLE_LINK6"&gt;&lt;/a&gt;&lt;a name="OLE_LINK5"&gt;&lt;/a&gt;&lt;span&gt;&lt;font face="Times New Roman" size="3"&gt;background &lt;/font&gt;&lt;/span&gt;&lt;font face="Times New Roman" size="3"&gt;color based on the list box value selection, it would be very helpful. &lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;"&gt;&lt;font face="Times New Roman" size="3"&gt;Thanks.&lt;/font&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;"&gt;&lt;font face="Times New Roman" size="3"&gt;&lt;/font&gt;&lt;/p&gt;</description></item></channel></rss>