<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Add Slider to a Visualforce Page with jQuery</title>
	<atom:link href="http://www.tehnrd.com/add-slider-to-a-visualforce-page-with-jquery/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tehnrd.com/add-slider-to-a-visualforce-page-with-jquery/</link>
	<description>Force.com - jQuery - Technology - Life</description>
	<lastBuildDate>Sun, 05 Feb 2012 03:04:17 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
	<item>
		<title>By: Jonny</title>
		<link>http://www.tehnrd.com/add-slider-to-a-visualforce-page-with-jquery/comment-page-1/#comment-7205</link>
		<dc:creator>Jonny</dc:creator>
		<pubDate>Tue, 09 Aug 2011 17:02:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.tehnrd.com/?p=321#comment-7205</guid>
		<description>Hey guys, I&#039;m struggling with defining a dynamic maximum value for the slider. I want the slider to range from 0 to a number defined by a separate custom field (Contact.Total_resources__c). All seems to work, except when I load up the Visualforce page, it sets both slider buttons TO the max value. I can then drag the sliders up and down, which successfully update ui.values[0] and ui.values [1]. But when I save (i.e. refresh the Visualforce page) the slider buttons are reset back to the max range value.

Can anyone pick a hole in this?:

        
        //This will load as soon as the page is ready and will setup our slider
        $(document).ready(function(){
            $(&quot;#slider-range&quot;).slider({ //This line creates a slider on the DIV specified, options are passed arguments, comma separated below
                range: true, //This give the slider and top and bottom
                min: 0, //Min value for slider
                max: &quot;{!Contact.Total_resources__c}&quot;, //Max value for slider
                values: [&#039;{!FlOOR(Contact.Resource_allocation_low__c)}&#039;, &#039;{!FLOOR(Contact.Resource_allocation_high__c)}&#039;], //Start values for the slider
                slide: function(event, ui){ //This function executes every time slider is moved and applies the slider values to the input fields as well as the output below the slider
                    document.getElementById(&#039;{!$Component.page.form.block.values.resourceallocationLow}&#039;).value = ui.values[0];
                    document.getElementById(&#039;{!$Component.page.form.block.values.resourceallocationHigh}&#039;).value = ui.values[1];
                    $(&quot;#amountValue&quot;).html(&#039;£&#039; + ui.values[0] + &#039; - £&#039; + ui.values[1]);
                }
            });
 
            //This line executes only once right after the page is loaded and after the slider is initialized. It creates the &quot;$273K - $611K&quot; text on load
            $(&quot;#amountValue&quot;).html(&#039;£&#039; + $(&quot;#slider-range&quot;).slider(&quot;values&quot;, 0) + &#039; - £&#039; + $(&quot;#slider-range&quot;).slider(&quot;values&quot;, 1));
        });
    </description>
		<content:encoded><![CDATA[<p>Hey guys, I&#8217;m struggling with defining a dynamic maximum value for the slider. I want the slider to range from 0 to a number defined by a separate custom field (Contact.Total_resources__c). All seems to work, except when I load up the Visualforce page, it sets both slider buttons TO the max value. I can then drag the sliders up and down, which successfully update ui.values[0] and ui.values [1]. But when I save (i.e. refresh the Visualforce page) the slider buttons are reset back to the max range value.</p>
<p>Can anyone pick a hole in this?:</p>
<p>        //This will load as soon as the page is ready and will setup our slider<br />
        $(document).ready(function(){<br />
            $(&#8220;#slider-range&#8221;).slider({ //This line creates a slider on the DIV specified, options are passed arguments, comma separated below<br />
                range: true, //This give the slider and top and bottom<br />
                min: 0, //Min value for slider<br />
                max: &#8220;{!Contact.Total_resources__c}&#8221;, //Max value for slider<br />
                values: ['{!FlOOR(Contact.Resource_allocation_low__c)}', '{!FLOOR(Contact.Resource_allocation_high__c)}'], //Start values for the slider<br />
                slide: function(event, ui){ //This function executes every time slider is moved and applies the slider values to the input fields as well as the output below the slider<br />
                    document.getElementById(&#8216;{!$Component.page.form.block.values.resourceallocationLow}&#8217;).value = ui.values[0];<br />
                    document.getElementById(&#8216;{!$Component.page.form.block.values.resourceallocationHigh}&#8217;).value = ui.values[1];<br />
                    $(&#8220;#amountValue&#8221;).html(&#8216;£&#8217; + ui.values[0] + &#8216; &#8211; £&#8217; + ui.values[1]);<br />
                }<br />
            });</p>
<p>            //This line executes only once right after the page is loaded and after the slider is initialized. It creates the &#8220;$273K &#8211; $611K&#8221; text on load<br />
            $(&#8220;#amountValue&#8221;).html(&#8216;£&#8217; + $(&#8220;#slider-range&#8221;).slider(&#8220;values&#8221;, 0) + &#8216; &#8211; £&#8217; + $(&#8220;#slider-range&#8221;).slider(&#8220;values&#8221;, 1));<br />
        });</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Wes</title>
		<link>http://www.tehnrd.com/add-slider-to-a-visualforce-page-with-jquery/comment-page-1/#comment-512</link>
		<dc:creator>Wes</dc:creator>
		<pubDate>Wed, 17 Feb 2010 11:42:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.tehnrd.com/?p=321#comment-512</guid>
		<description>Excellent article and good timing. I&#039;ve been working with a jQuery lib that works best with Ids (my page is MASSIVE and many of list items share a class) and was forced to climb into the topic of visualforce ids and jQuery.. and I think I&#039;ve found a solution (similar to Richard&#039;s in all honesty). Check my blog for deets.</description>
		<content:encoded><![CDATA[<p>Excellent article and good timing. I&#8217;ve been working with a jQuery lib that works best with Ids (my page is MASSIVE and many of list items share a class) and was forced to climb into the topic of visualforce ids and jQuery.. and I think I&#8217;ve found a solution (similar to Richard&#8217;s in all honesty). Check my blog for deets.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Schach</title>
		<link>http://www.tehnrd.com/add-slider-to-a-visualforce-page-with-jquery/comment-page-1/#comment-510</link>
		<dc:creator>David Schach</dc:creator>
		<pubDate>Wed, 17 Feb 2010 00:08:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.tehnrd.com/?p=321#comment-510</guid>
		<description>&lt;a href=&quot;#comment-509&quot; rel=&quot;nofollow&quot;&gt;@Mom &lt;/a&gt; 
That&#039;s cool. I never learned how to read. My man Alfred types for me as I dictate.  I wish my mom had been supportive of me wanting to learn to read.  You have it so good, Jason.</description>
		<content:encoded><![CDATA[<p><a href="#comment-509" rel="nofollow">@Mom </a><br />
That&#8217;s cool. I never learned how to read. My man Alfred types for me as I dictate.  I wish my mom had been supportive of me wanting to learn to read.  You have it so good, Jason.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mom</title>
		<link>http://www.tehnrd.com/add-slider-to-a-visualforce-page-with-jquery/comment-page-1/#comment-509</link>
		<dc:creator>Mom</dc:creator>
		<pubDate>Tue, 16 Feb 2010 23:57:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.tehnrd.com/?p=321#comment-509</guid>
		<description>Wow Jason, you have come along way since learning the alphabet! :)</description>
		<content:encoded><![CDATA[<p>Wow Jason, you have come along way since learning the alphabet! <img src='http://www.tehnrd.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff Douglas</title>
		<link>http://www.tehnrd.com/add-slider-to-a-visualforce-page-with-jquery/comment-page-1/#comment-508</link>
		<dc:creator>Jeff Douglas</dc:creator>
		<pubDate>Tue, 16 Feb 2010 21:31:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.tehnrd.com/?p=321#comment-508</guid>
		<description>Very cool! I like yours better. ;) Congrats!</description>
		<content:encoded><![CDATA[<p>Very cool! I like yours better. <img src='http://www.tehnrd.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  Congrats!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jason</title>
		<link>http://www.tehnrd.com/add-slider-to-a-visualforce-page-with-jquery/comment-page-1/#comment-507</link>
		<dc:creator>Jason</dc:creator>
		<pubDate>Tue, 16 Feb 2010 21:08:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.tehnrd.com/?p=321#comment-507</guid>
		<description>I tried to get something like that working once but couldn&#039;t get it to work:

http://community.salesforce.com/sforce/board/message?board.id=Visualforce&amp;message.id=19344</description>
		<content:encoded><![CDATA[<p>I tried to get something like that working once but couldn&#8217;t get it to work:</p>
<p><a href="http://community.salesforce.com/sforce/board/message?board.id=Visualforce&#038;message.id=19344" rel="nofollow">http://community.salesforce.com/sforce/board/message?board.id=Visualforce&#038;message.id=19344</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Richard</title>
		<link>http://www.tehnrd.com/add-slider-to-a-visualforce-page-with-jquery/comment-page-1/#comment-506</link>
		<dc:creator>Richard</dc:creator>
		<pubDate>Tue, 16 Feb 2010 20:47:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.tehnrd.com/?p=321#comment-506</guid>
		<description>Oh and wonderful post as always Jason.</description>
		<content:encoded><![CDATA[<p>Oh and wonderful post as always Jason.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Richard</title>
		<link>http://www.tehnrd.com/add-slider-to-a-visualforce-page-with-jquery/comment-page-1/#comment-505</link>
		<dc:creator>Richard</dc:creator>
		<pubDate>Tue, 16 Feb 2010 20:46:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.tehnrd.com/?p=321#comment-505</guid>
		<description>I ran into the same issues when I was using jQuery with vforce so I wrote this quick little javascript method:

function v2j(input) {
return &#039;#&#039;+input.replace(/([#;&amp;,\.\+\*~&#039;:&quot;!\^\$\[\]\(\)=&gt;\&#124;\/])/g,function(matchString,groupOne){return &quot;\\&quot;  + groupOne});
}
example usage:  jQuery(v2j(&#039;{!$Component.thecompid}&#039;)).hide();</description>
		<content:encoded><![CDATA[<p>I ran into the same issues when I was using jQuery with vforce so I wrote this quick little javascript method:</p>
<p>function v2j(input) {<br />
return &#8216;#&#8217;+input.replace(/([#;&amp;,\.\+\*~':"!\^\$\[\]\(\)=&gt;\|\/])/g,function(matchString,groupOne){return &#8220;\\&#8221;  + groupOne});<br />
}<br />
example usage:  jQuery(v2j(&#8216;{!$Component.thecompid}&#8217;)).hide();</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike Leach</title>
		<link>http://www.tehnrd.com/add-slider-to-a-visualforce-page-with-jquery/comment-page-1/#comment-504</link>
		<dc:creator>Mike Leach</dc:creator>
		<pubDate>Tue, 16 Feb 2010 20:29:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.tehnrd.com/?p=321#comment-504</guid>
		<description>Please vote up my idea on the AppExchange to support HTML5 custom data attributes in Visualforce markup. http://bit.ly/dlHAdl</description>
		<content:encoded><![CDATA[<p>Please vote up my idea on the AppExchange to support HTML5 custom data attributes in Visualforce markup. <a href="http://bit.ly/dlHAdl" rel="nofollow">http://bit.ly/dlHAdl</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jason</title>
		<link>http://www.tehnrd.com/add-slider-to-a-visualforce-page-with-jquery/comment-page-1/#comment-503</link>
		<dc:creator>Jason</dc:creator>
		<pubDate>Tue, 16 Feb 2010 20:05:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.tehnrd.com/?p=321#comment-503</guid>
		<description>Sorry about your markup getting stripped. I need to look into that. I don&#039;t think it will let you save unsupported attributes. Wes Nolte was asking about this same thing a few days ago.</description>
		<content:encoded><![CDATA[<p>Sorry about your markup getting stripped. I need to look into that. I don&#8217;t think it will let you save unsupported attributes. Wes Nolte was asking about this same thing a few days ago.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

