<?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: If Visualforce Blows, This Sucks</title>
	<atom:link href="http://www.tehnrd.com/if-visualforce-sucks-this-blows/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tehnrd.com/if-visualforce-sucks-this-blows/</link>
	<description>Force.com - jQuery - Technology - Life</description>
	<lastBuildDate>Wed, 08 Sep 2010 01:23:38 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: Kenji776</title>
		<link>http://www.tehnrd.com/if-visualforce-sucks-this-blows/comment-page-2/#comment-463</link>
		<dc:creator>Kenji776</dc:creator>
		<pubDate>Fri, 22 Jan 2010 21:00:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.tehnrd.com/?p=405#comment-463</guid>
		<description>Yup mostly got it running now. Just trying to work some of the bugs out of the sub menu systems (its displaying the same links for all menus). For anyone who cares, this is the code I have for the component. Maybe it will help someone in the future. This is also my first time using jQuery, so it may be a little more cludgy than it has to be.

jQuery(document).ready(function() 
{
    sforce.connection.sessionId = &#039;{!$Api.Session_ID}&#039;;
    var results = sforce.apex.execute(&#039;linkMenu&#039; , &#039;getLinks&#039;, {menuName: &#039;blah&#039; });
    dump(results);
    html = &#039;&#039;;
    counter = 0;
    jQuery.each(results,function(intIndex, LinkItem)
    {
        links = &#039;&#039;;
       
        jQuery.each(results[counter].Link_Items__r.records,function(intIndex, LinkData)
        {
            links += &quot;&lt;a href=&quot;+LinkData.URL__c+&quot; rel=&quot;nofollow&quot;&gt;&quot;+ LinkData.Label__c + &quot;&lt;/a&gt;&quot;;
        });
        links +=&quot; &quot;;
        
        html +=  &quot;&lt;a href=&quot;/tabid/125/Default.aspx&quot; rel=&quot;nofollow&quot;&gt;&quot;+LinkItem.Label__c+&quot;&lt;/a&gt;&quot;+links+&quot;&quot;;});
        var item = jQuery(html);
        // Insert the generated HTML - is slower to do one at a time but doing this way allows us to set Data
        document.getElementById(&#039;main-navigation&#039;).innerHTML += html;
        counter++;
    }
)</description>
		<content:encoded><![CDATA[<p>Yup mostly got it running now. Just trying to work some of the bugs out of the sub menu systems (its displaying the same links for all menus). For anyone who cares, this is the code I have for the component. Maybe it will help someone in the future. This is also my first time using jQuery, so it may be a little more cludgy than it has to be.</p>
<p>jQuery(document).ready(function()<br />
{<br />
    sforce.connection.sessionId = &#8216;{!$Api.Session_ID}&#8217;;<br />
    var results = sforce.apex.execute(&#8216;linkMenu&#8217; , &#8216;getLinks&#8217;, {menuName: &#8216;blah&#8217; });<br />
    dump(results);<br />
    html = &#8221;;<br />
    counter = 0;<br />
    jQuery.each(results,function(intIndex, LinkItem)<br />
    {<br />
        links = &#8221;;</p>
<p>        jQuery.each(results[counter].Link_Items__r.records,function(intIndex, LinkData)<br />
        {<br />
            links += &#8220;<a href="+LinkData.URL__c+" rel="nofollow">&#8220;+ LinkData.Label__c + &#8220;</a>&#8220;;<br />
        });<br />
        links +=&#8221; &#8220;;</p>
<p>        html +=  &#8220;<a href="/tabid/125/Default.aspx" rel="nofollow">&#8220;+LinkItem.Label__c+&#8221;</a>&#8220;+links+&#8221;";});<br />
        var item = jQuery(html);<br />
        // Insert the generated HTML &#8211; is slower to do one at a time but doing this way allows us to set Data<br />
        document.getElementById(&#8216;main-navigation&#8217;).innerHTML += html;<br />
        counter++;<br />
    }<br />
)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Richard</title>
		<link>http://www.tehnrd.com/if-visualforce-sucks-this-blows/comment-page-2/#comment-462</link>
		<dc:creator>Richard</dc:creator>
		<pubDate>Fri, 22 Jan 2010 20:28:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.tehnrd.com/?p=405#comment-462</guid>
		<description>Or of course I could read the thread on the developer forum and read that other people already found that this morning =x  lol

Glad you got this working finally.  In case anyone else ever finds this blog with a similar issue, remember to check the security permissions for the sites user if you&#039;re trying to use the api with sites.</description>
		<content:encoded><![CDATA[<p>Or of course I could read the thread on the developer forum and read that other people already found that this morning =x  lol</p>
<p>Glad you got this working finally.  In case anyone else ever finds this blog with a similar issue, remember to check the security permissions for the sites user if you&#8217;re trying to use the api with sites.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Richard</title>
		<link>http://www.tehnrd.com/if-visualforce-sucks-this-blows/comment-page-2/#comment-461</link>
		<dc:creator>Richard</dc:creator>
		<pubDate>Fri, 22 Jan 2010 20:24:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.tehnrd.com/?p=405#comment-461</guid>
		<description>Kenji,

Did you make this object accessible to the sites guest user?  I didn&#039;t realize you were doing this for a sites project.  If you ran this locally inside your dev box you&#039;d get it to run with your admin accounts session id, but since the sites user doesnt have access you&#039;re running into issues there.</description>
		<content:encoded><![CDATA[<p>Kenji,</p>
<p>Did you make this object accessible to the sites guest user?  I didn&#8217;t realize you were doing this for a sites project.  If you ran this locally inside your dev box you&#8217;d get it to run with your admin accounts session id, but since the sites user doesnt have access you&#8217;re running into issues there.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kenji776</title>
		<link>http://www.tehnrd.com/if-visualforce-sucks-this-blows/comment-page-2/#comment-460</link>
		<dc:creator>Kenji776</dc:creator>
		<pubDate>Fri, 22 Jan 2010 16:05:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.tehnrd.com/?p=405#comment-460</guid>
		<description>Hey I made a discussion on the boards.

http://community.salesforce.com/sforce/board/message?board.id=Visualforce&amp;thread.id=20624

We can stop spamming your blog now.
Sorry.</description>
		<content:encoded><![CDATA[<p>Hey I made a discussion on the boards.</p>
<p><a href="http://community.salesforce.com/sforce/board/message?board.id=Visualforce&amp;thread.id=20624" rel="nofollow">http://community.salesforce.com/sforce/board/message?board.id=Visualforce&amp;thread.id=20624</a></p>
<p>We can stop spamming your blog now.<br />
Sorry.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kenji776</title>
		<link>http://www.tehnrd.com/if-visualforce-sucks-this-blows/comment-page-2/#comment-459</link>
		<dc:creator>Kenji776</dc:creator>
		<pubDate>Fri, 22 Jan 2010 15:49:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.tehnrd.com/?p=405#comment-459</guid>
		<description>I tried making the simple web service (even in a whole new class in case there was something goofy with that last one) and still the same error.

Check out
http://fpitesters.testbed.cs0.force.com/

It calls the webservice onload (can use the button to force it as well). Same exact error. Can webservices not be called from a sandbox environment?</description>
		<content:encoded><![CDATA[<p>I tried making the simple web service (even in a whole new class in case there was something goofy with that last one) and still the same error.</p>
<p>Check out<br />
<a href="http://fpitesters.testbed.cs0.force.com/" rel="nofollow">http://fpitesters.testbed.cs0.force.com/</a></p>
<p>It calls the webservice onload (can use the button to force it as well). Same exact error. Can webservices not be called from a sandbox environment?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Richard</title>
		<link>http://www.tehnrd.com/if-visualforce-sucks-this-blows/comment-page-1/#comment-456</link>
		<dc:creator>Richard</dc:creator>
		<pubDate>Thu, 21 Jan 2010 23:28:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.tehnrd.com/?p=405#comment-456</guid>
		<description>Dave, I managed to get this code working on my end.  Thanks for showing me a new technique to get around the strange limitations of vforce.</description>
		<content:encoded><![CDATA[<p>Dave, I managed to get this code working on my end.  Thanks for showing me a new technique to get around the strange limitations of vforce.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Richard</title>
		<link>http://www.tehnrd.com/if-visualforce-sucks-this-blows/comment-page-1/#comment-455</link>
		<dc:creator>Richard</dc:creator>
		<pubDate>Thu, 21 Jan 2010 23:07:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.tehnrd.com/?p=405#comment-455</guid>
		<description>yea mine wasn&#039;t posting into the body with that jquery code, I even tried changing from body to #caseContainer (a div I created).  try after the sforce.apex.execute command to do this:   alert(results); 

then we&#039;ll know if the problem is elsewhere.</description>
		<content:encoded><![CDATA[<p>yea mine wasn&#8217;t posting into the body with that jquery code, I even tried changing from body to #caseContainer (a div I created).  try after the sforce.apex.execute command to do this:   alert(results); </p>
<p>then we&#8217;ll know if the problem is elsewhere.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Richard</title>
		<link>http://www.tehnrd.com/if-visualforce-sucks-this-blows/comment-page-1/#comment-454</link>
		<dc:creator>Richard</dc:creator>
		<pubDate>Thu, 21 Jan 2010 23:06:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.tehnrd.com/?p=405#comment-454</guid>
		<description>arghh it cut the list type I was mentioning... Maybe even your code defines that... tehnrd&#039;s blog likes to cut out code... gotta love wordpress.</description>
		<content:encoded><![CDATA[<p>arghh it cut the list type I was mentioning&#8230; Maybe even your code defines that&#8230; tehnrd&#8217;s blog likes to cut out code&#8230; gotta love wordpress.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave</title>
		<link>http://www.tehnrd.com/if-visualforce-sucks-this-blows/comment-page-1/#comment-453</link>
		<dc:creator>Dave</dc:creator>
		<pubDate>Thu, 21 Jan 2010 23:06:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.tehnrd.com/?p=405#comment-453</guid>
		<description>That looks okay to me.   In Firebug console window can you see the HTTP post to the service being made and returned ok?

Try this:
Class:
WebService static string hello(string name)
    {
        return &#039;hello &#039;+ name;
    }

Page:
  sforce.connection.sessionId = &#039;{!$Api.Session_ID}&#039;;
    var x = sforce.apex.execute(&#039;linkMenu&#039; , &#039;hello&#039;, {name: &#039;blah&#039; }) ;
   alert(x);</description>
		<content:encoded><![CDATA[<p>That looks okay to me.   In Firebug console window can you see the HTTP post to the service being made and returned ok?</p>
<p>Try this:<br />
Class:<br />
WebService static string hello(string name)<br />
    {<br />
        return &#8216;hello &#8216;+ name;<br />
    }</p>
<p>Page:<br />
  sforce.connection.sessionId = &#8216;{!$Api.Session_ID}&#8217;;<br />
    var x = sforce.apex.execute(&#8216;linkMenu&#8217; , &#8216;hello&#8217;, {name: &#8216;blah&#8217; }) ;<br />
   alert(x);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Richard</title>
		<link>http://www.tehnrd.com/if-visualforce-sucks-this-blows/comment-page-1/#comment-452</link>
		<dc:creator>Richard</dc:creator>
		<pubDate>Thu, 21 Jan 2010 23:05:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.tehnrd.com/?p=405#comment-452</guid>
		<description>I tested with this class and it seemed to work fine using the same syntax with changed class name, method name and variable name..  Try declaring the list as a List and see if that helps.. it seems like it shouldn&#039;t matter, but I don&#039;t see anything else wrong there.

global class testWS {
webservice static List caseList(String email) {
	return [select Id, Subject, CaseNumber, Status from Case where Account.personEmail = :email];
}
}</description>
		<content:encoded><![CDATA[<p>I tested with this class and it seemed to work fine using the same syntax with changed class name, method name and variable name..  Try declaring the list as a List and see if that helps.. it seems like it shouldn&#8217;t matter, but I don&#8217;t see anything else wrong there.</p>
<p>global class testWS {<br />
webservice static List caseList(String email) {<br />
	return [select Id, Subject, CaseNumber, Status from Case where Account.personEmail = :email];<br />
}<br />
}</p>
]]></content:encoded>
	</item>
</channel>
</rss>
